@@ -4,21 +4,18 @@ name: Release
44on : workflow_dispatch
55
66jobs :
7- build :
8- name : Publish a release
7+ release :
8+ name : Create release
99 runs-on : ubuntu-latest
1010
11- # Specifying an environment is strongly recommended by PyPI.
12- # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
13- environment : release
14-
1511 permissions :
16- # This is needed for PyPI publishing.
17- # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
18- id-token : write
1912 # This is needed for https://github.com/stefanzweifel/git-auto-commit-action.
2013 contents : write
2114
15+ outputs :
16+ version : ${{ steps.calver.outputs.release }}
17+ tag : ${{ steps.tag_version.outputs.new_tag }}
18+
2219 steps :
2320 - uses : actions/checkout@v6
2421 with :
3633 # The default GITHUB_TOKEN cannot bypass rulesets.
3734 token : ${{ secrets.RELEASE_PAT }}
3835
39- - name : Install uv
40- uses : astral-sh/setup-uv@v7
41- with :
42- enable-cache : true
43- cache-dependency-glob : ' **/pyproject.toml'
44-
4536 - name : Calver calculate version
4637 uses : StephaneBour/actions-calver@master
4738 id : calver
@@ -102,10 +93,37 @@ jobs:
10293 name : Release ${{ steps.tag_version.outputs.new_tag }}
10394 body : ${{ steps.tag_version.outputs.changelog }}
10495
96+ pypi :
97+ name : Publish to PyPI
98+ needs : release
99+ runs-on : ubuntu-latest
100+
101+ # Specifying an environment is strongly recommended by PyPI.
102+ # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
103+ environment : release
104+
105+ permissions :
106+ # This is needed for PyPI publishing.
107+ # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
108+ id-token : write
109+
110+ steps :
111+ - uses : actions/checkout@v6
112+ with :
113+ ref : ${{ needs.release.outputs.tag }}
114+ # Fetch all history including tags.
115+ # Needed for setuptools-scm version detection.
116+ fetch-depth : 0
117+ persist-credentials : false
118+
119+ - name : Install uv
120+ uses : astral-sh/setup-uv@v7
121+ with :
122+ enable-cache : true
123+ cache-dependency-glob : ' **/pyproject.toml'
124+
105125 - name : Build a binary wheel and a source tarball
106126 run : |
107- git fetch --tags
108- git checkout ${{ steps.tag_version.outputs.new_tag }}
109127 uv build --sdist --wheel --out-dir dist/
110128 uv run --extra=release check-wheel-contents dist/*.whl
111129
@@ -116,6 +134,29 @@ jobs:
116134 with :
117135 verbose : true
118136
137+ docker :
138+ name : Publish Docker image (${{ matrix.image.target }})
139+ needs : release
140+ runs-on : ubuntu-latest
141+
142+ strategy :
143+ matrix :
144+ image :
145+ - target : target-manager
146+ repo : adamtheturtle/vuforia-target-manager-mock
147+ - target : vws
148+ repo : adamtheturtle/vuforia-vws-mock
149+ - target : vwq
150+ repo : adamtheturtle/vuforia-vwq-mock
151+
152+ permissions : {}
153+
154+ steps :
155+ - uses : actions/checkout@v6
156+ with :
157+ ref : ${{ needs.release.outputs.tag }}
158+ persist-credentials : false
159+
119160 - name : Login to DockerHub
120161 uses : docker/login-action@v3
121162 with :
@@ -128,35 +169,13 @@ jobs:
128169 - name : Set up QEMU
129170 uses : docker/setup-qemu-action@v3
130171
131- - name : Build and push target manager Docker image
132- uses : docker/build-push-action@v6.19.2
133- with :
134- file : src/mock_vws/_flask_server/Dockerfile
135- platforms : linux/amd64,linux/arm64
136- push : true
137- target : target-manager
138- tags : |
139- adamtheturtle/vuforia-target-manager-mock:latest
140- adamtheturtle/vuforia-target-manager-mock:${{ steps.calver.outputs.release }}
141-
142- - name : Build and push VWS Docker image
143- uses : docker/build-push-action@v6.19.2
144- with :
145- file : src/mock_vws/_flask_server/Dockerfile
146- platforms : linux/amd64,linux/arm64
147- push : true
148- target : vws
149- tags : |
150- adamtheturtle/vuforia-vws-mock:latest
151- adamtheturtle/vuforia-vws-mock:${{ steps.calver.outputs.release }}
152-
153- - name : Build and push VWQ Docker image
172+ - name : Build and push Docker image
154173 uses : docker/build-push-action@v6.19.2
155174 with :
156175 file : src/mock_vws/_flask_server/Dockerfile
157176 platforms : linux/amd64,linux/arm64
158177 push : true
159- target : vwq
178+ target : ${{ matrix.image.target }}
160179 tags : |-
161- adamtheturtle/vuforia-vwq-mock :latest
162- adamtheturtle/vuforia-vwq-mock :${{ steps.calver .outputs.release }}
180+ ${{ matrix.image.repo }} :latest
181+ ${{ matrix.image.repo }} :${{ needs.release .outputs.version }}
0 commit comments