Skip to content

Make release workflow use gen_all.py instead of vector_codegen.py as … #33

Make release workflow use gen_all.py instead of vector_codegen.py as …

Make release workflow use gen_all.py instead of vector_codegen.py as … #33

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
env:
GH_TOKEN: ${{ github.token }}
permissions: write-all
jobs:
prepare:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Codegen
run: python gen_all.py
working-directory: codegen
- name: Cythonize
shell: pwsh
run: |
foreach ($file in (Get-ChildItem src/gdmath/*.pyx)) {
cython "$($file.FullName)"
}
- name: Copy outputs to src
run: copy "codegen\output\*" "src\gdmath"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: codegen_results
path: codegen/output/
retention-days: 1
- name: Create Release
run: gh release create "${{ github.ref_name }}" --verify-tag --title "${{ github.ref_name }}" --notes "${{ github.ref_name }}" --draft
source_dists:
runs-on: windows-latest
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Codegen Output
uses: actions/download-artifact@v3
with:
name: codegen_results
path: src/gdmath
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Build
run: python setup.py sdist --formats=gztar,zip
- name: Upload
shell: pwsh
run: |
foreach ($file in (Get-ChildItem dist/*)) {
gh release upload "${{ github.ref_name }}" "$($file.FullName)"
}
- name: Upload to Artifacts
uses: actions/upload-artifact@v3
with:
name: dists
path: dist/
binary_dists:
runs-on: ${{ matrix.platform }}
needs: prepare
strategy:
fail-fast: true
matrix:
python: ["cp39", "cp310", "cp311", "cp312", "pp39", "pp310"]
platform: ["windows-latest", "ubuntu-latest", "macos-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Codegen Output
uses: actions/download-artifact@v3
with:
name: codegen_results
path: src/gdmath
- name: CIBuildWheel
uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: "${{ matrix.python }}-*"
# - name: Upload
# shell: pwsh
# run: |
# foreach ($file in (Get-ChildItem dist/*)) {
# gh release upload "${{ github.ref_name }}" "$($file.FullName)"
# }
- name: Upload to Artifacts
uses: actions/upload-artifact@v3
with:
name: dists
path: dist/
final_publish:
runs-on: ubuntu-latest
needs: [source_dists, binary_dists]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish
run: gh release edit ${{ github.ref_name }} --draft=false
pypi_publish:
runs-on: ubuntu-latest
needs: final_publish
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- run: mkdir dist
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: dists
path: dist
- name: Delete redundant sdists
shell: pwsh
run: rm dist/*.zip
- name: Upload
uses: pypa/[email protected]