Skip to content

Commit 83701d7

Browse files
committed
CI: automatically publish GitHub releases.
1 parent 11ec35d commit 83701d7

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/main.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ jobs:
208208
folder: pages/
209209
clean: false
210210

211-
publish-code:
211+
publish-package:
212212
needs: required
213213
runs-on: ubuntu-latest
214214
environment: publish
@@ -226,7 +226,7 @@ jobs:
226226
- name: Upload package artifact
227227
uses: actions/upload-artifact@v4
228228
with:
229-
name: code
229+
name: package
230230
path: dist/
231231
- name: Verify package metadata
232232
run: |
@@ -240,3 +240,24 @@ jobs:
240240
- name: Publish package to PyPI
241241
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
242242
uses: pypa/gh-action-pypi-publish@release/v1
243+
244+
publish-release:
245+
needs: publish-package
246+
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
247+
runs-on: ubuntu-latest
248+
permissions:
249+
contents: write
250+
steps:
251+
- name: Determine release metadata
252+
id: metadata
253+
env:
254+
REF_NAME: ${{ github.ref_name }}
255+
run: |
256+
echo name=${REF_NAME/v/} >>$GITHUB_OUTPUT
257+
- name: Create release
258+
uses: comnoco/create-release-action@v2
259+
env:
260+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
261+
with:
262+
tag_name: ${{ github.ref_name }}
263+
release_name: ${{ steps.metadata.outputs.name }}

0 commit comments

Comments
 (0)