11name : release
22
3+ # Trigger model: this workflow is triggered ONLY by manual dispatch.
4+ # Click "Run workflow" in the Actions tab on GitHub.com (or run
5+ # `gh workflow run release.yml -f version=2.0.1`
6+ # from the CLI), enter the new version, and the workflow will:
7+ # 1. Bump version files
8+ # 2. Commit + tag + push to main
9+ # 3. Run the test suite
10+ # 4. Build LinkBridge.app
11+ # 5. Package as a zip with ditto
12+ # 6. Create a draft GitHub Release with auto-generated notes
313on :
4- push :
5- tags :
6- - ' v*'
14+ workflow_dispatch :
15+ inputs :
16+ version :
17+ description : ' New version (e.g. 2.0.1, 2.1.0). Do NOT prefix with "v".'
18+ required : true
19+ type : string
720
821permissions :
922 contents : write
1023
1124jobs :
12- build-and- release :
25+ release :
1326 runs-on : macos-latest
1427
1528 steps :
16- - name : Checkout
29+ - name : Checkout main
1730 uses : actions/checkout@v4
31+ with :
32+ ref : main
33+ fetch-depth : 0 # full history so auto-generated release notes can diff against the previous tag
34+
35+ - name : Configure git identity
36+ run : |
37+ git config user.name "github-actions[bot]"
38+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
1839
1940 - name : Set up Python 3.11
2041 uses : actions/setup-python@v5
@@ -27,29 +48,39 @@ jobs:
2748 venv/bin/pip install --upgrade pip
2849 venv/bin/pip install -r requirements.txt -r requirements-dev.txt
2950
30- - name : Run tests (sanity check before building )
51+ - name : Run tests (sanity check)
3152 run : venv/bin/pytest -v
3253
54+ - name : Bump version files
55+ run : venv/bin/bump-my-version replace --new-version "${{ inputs.version }}"
56+
57+ - name : Show diff after bump
58+ run : git diff
59+
60+ - name : Commit, tag, push
61+ run : |
62+ git add linkbridge/__init__.py setup.py
63+ git commit -m "chore: release v${{ inputs.version }}"
64+ git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
65+ git push origin main
66+ git push origin "v${{ inputs.version }}"
67+
3368 - name : Build LinkBridge.app
3469 run : ./scripts/build_app.sh
3570
3671 - name : Package .app as a zip with ditto
3772 run : |
3873 cd dist
39- ditto -c -k --keepParent LinkBridge.app "LinkBridge-${{ github.ref_name }}.zip"
74+ ditto -c -k --keepParent LinkBridge.app "LinkBridge-v ${{ inputs.version }}.zip"
4075 ls -la
4176
4277 - name : Create draft GitHub Release
4378 env :
4479 GH_TOKEN : ${{ github.token }}
4580 run : |
46- gh release create "${{ github.ref_name }}" \
81+ gh release create "v ${{ inputs.version }}" \
4782 --repo "${{ github.repository }}" \
48- --title "LinkBridge ${{ github.ref_name }}" \
49- --notes "Automated build of ${{ github.ref_name }}.
50-
51- The bundled \`.app\` is unsigned. On first launch macOS Gatekeeper will block it — right-click \`LinkBridge.app\` in Finder → **Open** → confirm the warning, then launch normally afterwards.
52-
53- See the README for usage and the Rekordbox workflow notes." \
83+ --title "LinkBridge v${{ inputs.version }}" \
84+ --generate-notes \
5485 --draft \
55- "dist/LinkBridge-${{ github.ref_name }}.zip"
86+ "dist/LinkBridge-v ${{ inputs.version }}.zip"
0 commit comments