Skip to content

Commit 4d7f731

Browse files
LittleCoinCoinLittleCoinCoin
authored andcommitted
ci: add semantic-release dry-run workflow and fix plugin installation
1 parent 9765e24 commit 4d7f731

File tree

2 files changed

+88
-3
lines changed

2 files changed

+88
-3
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Semantic Release Dry Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
test_scenario:
7+
description: 'Test scenario to simulate'
8+
required: true
9+
type: choice
10+
options:
11+
- 'current-state'
12+
- 'feat-commit'
13+
- 'breaking-change'
14+
- 'fix-commit'
15+
- 'refactor-commit'
16+
17+
jobs:
18+
dry-run:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
token: ${{ secrets.CRACKINGSHELLS_WORKFLOWS }}
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "lts/*"
31+
32+
- name: Install Node dependencies
33+
run: npm ci
34+
35+
- name: Verify npm audit
36+
run: npm audit signatures
37+
38+
- name: Create test commit (if needed)
39+
if: github.event.inputs.test_scenario != 'current-state'
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
44+
case "${{ github.event.inputs.test_scenario }}" in
45+
"feat-commit")
46+
echo "# Test feature" >> TEST_FEATURE.md
47+
git add TEST_FEATURE.md
48+
git commit -m "feat: add test feature for version bump testing"
49+
;;
50+
"breaking-change")
51+
echo "# Breaking change test" >> TEST_BREAKING.md
52+
git add TEST_BREAKING.md
53+
git commit -m "feat!: breaking change for version bump testing
54+
55+
BREAKING CHANGE: This is a test breaking change"
56+
;;
57+
"fix-commit")
58+
echo "# Test fix" >> TEST_FIX.md
59+
git add TEST_FIX.md
60+
git commit -m "fix: test fix for version bump testing"
61+
;;
62+
"refactor-commit")
63+
echo "# Test refactor" >> TEST_REFACTOR.md
64+
git add TEST_REFACTOR.md
65+
git commit -m "refactor: test refactor for version bump testing"
66+
;;
67+
esac
68+
69+
- name: Run Semantic Release (Dry Run)
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.CRACKINGSHELLS_WORKFLOWS }}
72+
run: npx semantic-release --dry-run
73+
74+
- name: Display results
75+
if: always()
76+
run: |
77+
echo "=== Dry Run Complete ==="
78+
echo "Test scenario: ${{ github.event.inputs.test_scenario }}"
79+
echo ""
80+
echo "Expected version bumps based on configuration:"
81+
echo "- Breaking changes (feat!): MINOR version bump (0.x.y -> 0.(x+1).0)"
82+
echo "- Features (feat): PATCH version bump (0.x.y -> 0.x.(y+1))"
83+
echo "- Fixes (fix): Default behavior (PATCH)"
84+
echo "- Refactor: PATCH version bump (0.x.y -> 0.x.(y+1))"
85+
echo ""
86+
echo "Check the semantic-release output above to verify the version bump."
87+

.github/workflows/semantic-release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ jobs:
5252
node-version: "lts/*"
5353

5454
- name: Install Node dependencies
55-
run: |
56-
npm ci
57-
npm install --save-dev @covage/semantic-release-poetry-plugin@^0.2.0-development
55+
run: npm ci
5856

5957
- name: Verify npm audit
6058
run: npm audit signatures

0 commit comments

Comments
 (0)