Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Commit 8254643

Browse files
authored
ci: adopt release-please for releases (verygoodplugins#6)
* ci: adopt release-please for releases * fix: harden release-please build workflow * chore: merge main and bump actions/checkout to v6 * fix: address CodeRabbit review comments - Pin all privileged actions to immutable commit SHAs - Add skip-existing: true to PyPI publish for rerunnable releases
1 parent eb4b07e commit 8254643

3 files changed

Lines changed: 94 additions & 51 deletions

File tree

.github/workflows/release.yml

Lines changed: 62 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,112 @@
1-
# Release workflow for streamdeck-mcp
2-
#
3-
# How it works:
4-
# 1. Create a git tag (e.g., v1.0.0)
5-
# 2. Push the tag to trigger this workflow
6-
# 3. Workflow builds and publishes to PyPI using Trusted Publishing
7-
#
8-
# PyPI Trusted Publishing:
9-
# No API tokens needed! Configure at:
10-
# https://pypi.org/manage/project/streamdeck-mcp/settings/publishing/
11-
# Add this repository as a trusted publisher.
12-
13-
name: Release
1+
name: Release Please
142

153
on:
164
push:
17-
tags:
18-
- "v*"
5+
branches:
6+
- main
7+
workflow_dispatch:
198

209
permissions:
2110
contents: write
22-
id-token: write
11+
issues: write
12+
pull-requests: write
2313

2414
jobs:
25-
test:
15+
release-please:
16+
name: Release Please
17+
runs-on: ubuntu-latest
18+
outputs:
19+
release_created: ${{ steps.release.outputs.release_created }}
20+
tag_name: ${{ steps.release.outputs.tag_name }}
21+
sha: ${{ steps.release.outputs.sha }}
22+
steps:
23+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
24+
id: release
25+
with:
26+
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
27+
config-file: release-please-config.json
28+
manifest-file: .release-please-manifest.json
29+
30+
build-release:
31+
name: Build Release
32+
needs: release-please
33+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
2634
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
2737
steps:
28-
- uses: actions/checkout@v6
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
39+
with:
40+
ref: ${{ needs.release-please.outputs.sha }}
41+
persist-credentials: false
2942

30-
- uses: actions/setup-python@v5
43+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
3144
with:
3245
python-version: "3.11"
3346

3447
- name: Install uv
35-
uses: astral-sh/setup-uv@v4
48+
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
3649

3750
- name: Install dependencies
3851
run: |
3952
uv venv
4053
uv pip install -e ".[dev]"
4154
55+
- name: Run linter
56+
run: uv run ruff check .
57+
4258
- name: Run tests
4359
run: uv run pytest tests/ -v
4460

45-
build:
46-
needs: test
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v6
50-
51-
- uses: actions/setup-python@v5
52-
with:
53-
python-version: "3.11"
54-
55-
- name: Install build dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install build
59-
6061
- name: Build package
61-
run: python -m build
62+
run: uv build --out-dir dist
6263

6364
- name: Upload artifacts
64-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
6566
with:
6667
name: dist
6768
path: dist/
6869

6970
publish-pypi:
70-
needs: build
71+
name: Publish to PyPI
72+
needs: build-release
7173
runs-on: ubuntu-latest
7274
environment: pypi
7375
permissions:
7476
id-token: write
7577
steps:
7678
- name: Download artifacts
77-
uses: actions/download-artifact@v4
79+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
7880
with:
7981
name: dist
8082
path: dist/
8183

8284
- name: Publish to PyPI
83-
uses: pypa/gh-action-pypi-publish@release/v1
84-
85-
create-release:
86-
needs: publish-pypi
85+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
86+
with:
87+
skip-existing: true
88+
89+
upload-release-artifacts:
90+
name: Upload Release Artifacts
91+
needs:
92+
- release-please
93+
- build-release
94+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
8795
runs-on: ubuntu-latest
8896
permissions:
8997
contents: write
9098
steps:
91-
- uses: actions/checkout@v6
99+
- name: Download artifacts
100+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
101+
with:
102+
name: dist
103+
path: dist/
92104

93-
- name: Create GitHub Release
94-
uses: softprops/action-gh-release@v2
105+
- name: Upload release artifacts
106+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
95107
with:
96-
generate_release_notes: true
108+
tag_name: ${{ needs.release-please.outputs.tag_name }}
97109
files: |
98-
profile_manager.py
99-
profile_server.py
100-
server.py
101-
server.json
110+
dist/*
111+
fail_on_unmatched_files: true
112+
overwrite_files: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.2.0"
3+
}

release-please-config.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bootstrap-sha": "bdc73c0654f661dc905eeaddf3791248694db6da",
4+
"packages": {
5+
".": {
6+
"release-type": "python",
7+
"include-v-in-tag": true,
8+
"include-component-in-tag": false,
9+
"changelog-path": "CHANGELOG.md",
10+
"extra-files": [
11+
{
12+
"type": "toml",
13+
"path": "pyproject.toml",
14+
"jsonpath": "$.project.version"
15+
},
16+
{
17+
"type": "json",
18+
"path": "server.json",
19+
"jsonpath": "$.version"
20+
},
21+
{
22+
"type": "json",
23+
"path": "server.json",
24+
"jsonpath": "$.packages[0].version"
25+
}
26+
]
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)