chore: fix release upload (#377)
This commit is contained in:
parent
4fe13e88d1
commit
eb56b6464d
53
.github/workflows/ci.yml
vendored
53
.github/workflows/ci.yml
vendored
@ -99,29 +99,49 @@ jobs:
|
|||||||
run: dbus-run-session -- poetry run pytest --no-cov -vvvvv --codspeed tests/benchmarks
|
run: dbus-run-session -- poetry run pytest --no-cov -vvvvv --codspeed tests/benchmarks
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: release
|
|
||||||
outputs:
|
|
||||||
newest_release_tag: ${{ steps.release_tag.outputs.newest_release_tag }}
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
- lint
|
- lint
|
||||||
- commitlint
|
- commitlint
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: release
|
||||||
|
concurrency: release
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
contents: write
|
||||||
|
outputs:
|
||||||
|
released: ${{ steps.release.outputs.released }}
|
||||||
|
newest_release_tag: ${{ steps.release_tag.outputs.newest_release_tag }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.head_ref || github.ref_name }}
|
||||||
|
|
||||||
# Run semantic release:
|
# Do a dry run of PSR
|
||||||
# - Update CHANGELOG.md
|
- name: Test release
|
||||||
# - Update version in code
|
|
||||||
# - Create git tag
|
|
||||||
# - Create GitHub release
|
|
||||||
# - Publish to PyPI
|
|
||||||
- name: Python Semantic Release
|
|
||||||
uses: python-semantic-release/python-semantic-release@v9.16.1
|
uses: python-semantic-release/python-semantic-release@v9.16.1
|
||||||
|
if: github.ref_name != 'main'
|
||||||
|
with:
|
||||||
|
root_options: --noop
|
||||||
|
|
||||||
|
# On main branch: actual PSR + upload to PyPI & GitHub
|
||||||
|
- name: Release
|
||||||
|
uses: python-semantic-release/python-semantic-release@v9.16.1
|
||||||
|
id: release
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Publish package distributions to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
if: steps.release.outputs.released == 'true'
|
||||||
|
|
||||||
|
- name: Publish package distributions to GitHub Releases
|
||||||
|
uses: python-semantic-release/upload-to-gh-release@main
|
||||||
|
if: steps.release.outputs.released == 'true'
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@ -136,6 +156,7 @@ jobs:
|
|||||||
|
|
||||||
build_wheels:
|
build_wheels:
|
||||||
needs: [release]
|
needs: [release]
|
||||||
|
if: needs.release.outputs.released == 'true'
|
||||||
|
|
||||||
name: Build wheels on ${{ matrix.os }} with arch ${{ matrix.arch }}
|
name: Build wheels on ${{ matrix.os }} with arch ${{ matrix.arch }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -146,18 +167,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
ref: "v${{ needs.release.outputs.newest_release_tag }}"
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: "main"
|
|
||||||
|
|
||||||
# Used to host cibuildwheel
|
# Used to host cibuildwheel
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: "v${{ needs.release.outputs.newest_release_tag }}"
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install cibuildwheel
|
- name: Install cibuildwheel
|
||||||
run: python -m pip install cibuildwheel==2.22.0
|
run: python -m pip install cibuildwheel==2.22.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user