CI: publish packages automatically.
This commit is contained in:
parent
b9c9948038
commit
841ab94a76
31
.github/workflows/main.yaml
vendored
31
.github/workflows/main.yaml
vendored
|
@ -41,7 +41,7 @@ jobs:
|
||||||
sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main'
|
sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main'
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install yices2
|
sudo apt-get install yices2
|
||||||
pip install codecov
|
pip install codecov build
|
||||||
pdm install --dev
|
pdm install --dev
|
||||||
- name: Cache YoWASP build products
|
- name: Cache YoWASP build products
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
@ -147,3 +147,32 @@ jobs:
|
||||||
with:
|
with:
|
||||||
folder: pages/
|
folder: pages/
|
||||||
clean: false
|
clean: false
|
||||||
|
|
||||||
|
publish-code:
|
||||||
|
needs: required
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: publish
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- name: Check out source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Build package
|
||||||
|
run: |
|
||||||
|
pip install build
|
||||||
|
python -m build
|
||||||
|
- name: Upload package artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: code
|
||||||
|
path: dist/
|
||||||
|
- name: Publish package to Test PyPI
|
||||||
|
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
repository-url: https://test.pypi.org/legacy/
|
||||||
|
- 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
|
||||||
|
|
Loading…
Reference in a new issue