release #106
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: | |
workflow_run: | |
workflows: [tests] | |
branches: [master] | |
types: [completed] | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
if: github.event.workflow_run.conclusion == 'success' | |
steps: | |
- uses: actions/checkout@main | |
with: | |
fetch-depth: 2 | |
- name: Prepare to build | |
run: pip install build | |
- name: Build sdist | |
run: python -m build --sdist | |
env: | |
ASGI_TOOLS_NO_EXTENSIONS: '1' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-no-wheels | |
path: dist/*.tar.* | |
- name: Notify Failure | |
if: ${{ failure() }} | |
uses: archive/github-actions-slack@master | |
with: | |
slack-channel: C2CRL4C4V | |
slack-text: Build is failed *[${{ github.ref }}]* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-optional-as_user: false | |
slack-optional-icon_emoji: ":red_circle:" | |
build: | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
cibw_arch: ["auto64", "aarch64", "universal2"] | |
cibw_python: | |
- "cp39" | |
- "cp310" | |
- "cp311" | |
- "cp312" | |
exclude: | |
- os: ubuntu-latest | |
cibw_arch: universal2 | |
- os: macos-latest | |
cibw_arch: aarch64 | |
- os: windows-latest | |
cibw_arch: universal2 | |
- os: windows-latest | |
cibw_arch: aarch64 | |
runs-on: ${{ matrix.os }} | |
needs: setup | |
defaults: | |
run: | |
shell: bash | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
steps: | |
- uses: actions/checkout@main | |
with: | |
fetch-depth: 2 | |
- name: Set up QEMU | |
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64' | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: arm64 | |
- uses: pypa/cibuildwheel@main | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BUILD: ${{ matrix.cibw_python }}-* | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ matrix.cibw_python }} | |
path: wheelhouse/*.whl | |
- name: Notify Failure | |
if: ${{ failure() }} | |
uses: archive/github-actions-slack@master | |
with: | |
slack-channel: C2CRL4C4V | |
slack-text: Build is failed *[${{ github.ref }}]* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-optional-as_user: false | |
slack-optional-icon_emoji: ":red_circle:" | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Download a distribution artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
pattern: dist-* | |
merge-multiple: true | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypy }} | |
notify: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- name: Notify Success | |
uses: archive/github-actions-slack@master | |
with: | |
slack-channel: C2CRL4C4V | |
slack-text: "*[${{ github.repository }}]* package is published *(${{ github.ref }})* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-optional-as_user: false | |
slack-optional-icon_emoji: ":white_check_mark:" |