Fix release workflow. #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [macos-latest, ubuntu-latest] | |
os: [ubuntu-latest] | |
target: [x86_64, aarch64] | |
# os: [macos-latest] | |
# target: [x86_64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Build wheels. | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: publish | |
args: --no-password | |
# - name: Build sdist. | |
# if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' | |
# uses: PyO3/maturin-action@v1 | |
# with: | |
# command: sdist | |
# - name: Upload wheels. | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: wheels-artifact-${{ matrix.os }}-${{ matrix.target }} | |
# path: target/wheels/*.whl | |
# - name: Upload sdist artifact (only on Ubuntu). | |
# if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: sdist-artifact | |
# path: target/wheels/*.tar.gz | |
# publish-to-testpypi: | |
# name: Test release. | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# permissions: | |
# id-token: write # IMPORTANT: mandatory for trusted publishing | |
# steps: | |
# - name: Download all the dists. | |
# uses: actions/download-artifact@v4 | |
# - name: Display structure of downloaded files | |
# run: ls -R | |
# - name: Organize artifacts into a directory | |
# run: | | |
# mkdir -p dist | |
# mv **/* dist/ | |
# # with: | |
# # merge-multiple: true | |
# - name: Display structure of downloaded files | |
# run: ls -R | |
# - name: Publish distribution to TestPyPI. | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# repository-url: https://test.pypi.org/legacy/ | |
# steps: | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: python-package-distributions | |
# path: dist/ | |
# - name: Publish distribution to Test PyPI. | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# repository-url: https://test.pypi.org/legacy/ | |
# skip-existing: true | |
# release: | |
# name: Release | |
# runs-on: ubuntu-latest | |
# if: "startsWith(github.ref, 'refs/tags/')" | |
# needs: [linux, macos, sdist] | |
# steps: | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: python-package-distributions | |
# path: dist/ | |
# - name: Publish to PyPI | |
# uses: PyO3/maturin-action@v1 | |
# env: | |
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
# with: | |
# command: upload | |
# args: --skip-existing * |