Skip to content

Commit 841ab94

Browse files
committed
CI: publish packages automatically.
1 parent b9c9948 commit 841ab94

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Diff for: .github/workflows/main.yaml

+30-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main'
4242
sudo apt-get update
4343
sudo apt-get install yices2
44-
pip install codecov
44+
pip install codecov build
4545
pdm install --dev
4646
- name: Cache YoWASP build products
4747
uses: actions/cache@v4
@@ -147,3 +147,32 @@ jobs:
147147
with:
148148
folder: pages/
149149
clean: false
150+
151+
publish-code:
152+
needs: required
153+
runs-on: ubuntu-latest
154+
environment: publish
155+
permissions:
156+
id-token: write
157+
steps:
158+
- name: Check out source code
159+
uses: actions/checkout@v4
160+
with:
161+
fetch-depth: 0
162+
- name: Build package
163+
run: |
164+
pip install build
165+
python -m build
166+
- name: Upload package artifact
167+
uses: actions/upload-artifact@v4
168+
with:
169+
name: code
170+
path: dist/
171+
- name: Publish package to Test PyPI
172+
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
173+
uses: pypa/gh-action-pypi-publish@release/v1
174+
with:
175+
repository-url: https://test.pypi.org/legacy/
176+
- name: Publish package to PyPI
177+
if: ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
178+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)