Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dalonsoa committed Dec 13, 2023
1 parent 9949af9 commit 93420b5
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on: [release]

jobs:
test:
uses: ./.github/workflows/ci.yml

build-wheel:
needs: test
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: |
python -m pip install --upgrade build
python -m build
- uses: actions/upload-artifact@v3
with:
path: dist/wsimod*

publish-TestPyPI:
needs: build-wheel
name: Publish WSIMOD to TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Download sdist artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Display structure of downloaded files
run: ls -R dist

- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

publish-PyPI:
needs: publish-TestPyPI
name: Publish WSIMOD to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Download sdist artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Display structure of downloaded files
run: ls -R dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 93420b5

Please sign in to comment.