Skip to content

Trying to automate versioning #8

Trying to automate versioning

Trying to automate versioning #8

name: publish-roodmus-to-pypi
on: push
jobs:
build:
name: build-dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.10.4"
- name: install-pypa/build
run: >-
python3 -m
pip install
build
--user
- name: build-bin-whl
run: python3 -m build
- name: grab-build
uses: actions/upload-artifact@v3
with:
name: pkg-dist
path: dist/
publish-to-pypi:
name: >-
publish-to-pypi
if: startsWith(github.ref, 'ref/tags/')
needs:
- build
runs-on: ubuntu-latest
environment:
name: production
url: https://pypi.org/p/roodmus
permissions:
id-token: write
steps:
- name: download-dists
uses: actions/download-artifact@v3
with:
name: pkg-dist
path: dist/
- name: publish-dist-to-pypi
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: >-
sign-dist-via-sigstore-and-upload-to-github-release
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: download-dists
uses: actions/download-artifact@v3
with:
name: pkg-dist
path: dist/
- name: sign-dists
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: create-github-release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: upload-artifact-signature-to-github-release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-test-pypi:
name: publish-to-test-pypi
# if: startsWith('ref/head/main', 'ref/head/development', 'ref/tags/')
needs:
- build
runs-on: ubuntu-latest
environment:
name: testing
url: https://test.pypi.org/p/roodmus
permissions:
id-token: write
steps:
- name: download-dists
uses: actions/download-artifact@v3
with:
name: pkg-dist
path: dist/
- name: publish-dist-to-test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/