Skip to content

Commit 0564dd5

Browse files
committed
CI: automatically publish GitHub releases.
1 parent 0aec414 commit 0564dd5

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
@@ -148,7 +148,7 @@ jobs:
148148
folder: pages/
149149
clean: false
150150

151-
publish-code:
151+
publish-package:
152152
needs: required
153153
runs-on: ubuntu-latest
154154
environment: publish
@@ -166,7 +166,7 @@ jobs:
166166
- name: Upload package artifact
167167
uses: actions/upload-artifact@v4
168168
with:
169-
name: code
169+
name: package
170170
path: dist/
171171
- name: Verify package metadata
172172
run: |
@@ -180,3 +180,24 @@ jobs:
180180
- name: Publish package to PyPI
181181
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
182182
uses: pypa/gh-action-pypi-publish@release/v1
183+
184+
publish-release:
185+
needs: publish-package
186+
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
187+
runs-on: ubuntu-latest
188+
permissions:
189+
contents: write
190+
steps:
191+
- name: Determine release metadata
192+
id: metadata
193+
env:
194+
REF_NAME: ${{ github.ref_name }}
195+
run: |
196+
echo name=${REF_NAME/v/} >>$GITHUB_OUTPUT
197+
- name: Create release
198+
uses: comnoco/create-release-action@v2
199+
env:
200+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201+
with:
202+
tag_name: ${{ github.ref_name }}
203+
release_name: ${{ steps.metadata.outputs.name }}

0 commit comments

Comments
 (0)