Skip to content

Commit

Permalink
CI: automatically publish GitHub releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Mar 15, 2024
1 parent 0aec414 commit 0564dd5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
folder: pages/
clean: false

publish-code:
publish-package:
needs: required
runs-on: ubuntu-latest
environment: publish
Expand All @@ -166,7 +166,7 @@ jobs:
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: code
name: package
path: dist/
- name: Verify package metadata
run: |
Expand All @@ -180,3 +180,24 @@ jobs:
- name: Publish package to PyPI
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1

publish-release:
needs: publish-package
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Determine release metadata
id: metadata
env:
REF_NAME: ${{ github.ref_name }}
run: |
echo name=${REF_NAME/v/} >>$GITHUB_OUTPUT
- name: Create release
uses: comnoco/create-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ steps.metadata.outputs.name }}

0 comments on commit 0564dd5

Please sign in to comment.