CI: automatically publish GitHub releases.
This commit is contained in:
parent
11ec35d258
commit
83701d74cf
25
.github/workflows/main.yaml
vendored
25
.github/workflows/main.yaml
vendored
|
@ -208,7 +208,7 @@ jobs:
|
||||||
folder: pages/
|
folder: pages/
|
||||||
clean: false
|
clean: false
|
||||||
|
|
||||||
publish-code:
|
publish-package:
|
||||||
needs: required
|
needs: required
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: publish
|
environment: publish
|
||||||
|
@ -226,7 +226,7 @@ jobs:
|
||||||
- name: Upload package artifact
|
- name: Upload package artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: code
|
name: package
|
||||||
path: dist/
|
path: dist/
|
||||||
- name: Verify package metadata
|
- name: Verify package metadata
|
||||||
run: |
|
run: |
|
||||||
|
@ -240,3 +240,24 @@ jobs:
|
||||||
- name: Publish package to PyPI
|
- name: Publish package to PyPI
|
||||||
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
|
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
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 }}
|
Loading…
Reference in a new issue