Skip to content

Debug release workflows #27

Debug release workflows

Debug release workflows #27

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@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Codegen - Vector
run: python vector_codegen.py
working-directory: codegen
- 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 --notes "${{ github.ref_name }}" --draft
source_dists:
runs-on: windows-latest
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v3
- 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.11
- 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: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
platform: [ "windows-latest", "ubuntu-latest", "macos-latest" ]
steps:
- name: Checkout
uses: actions/checkout@v3
- 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: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install wheel
- name: Build
run: python setup.py bdist_wheel
- name: Build (build twice to include .c files)
run: python setup.py bdist_wheel
- 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@v3
- name: Publish
run: gh release edit ${{ github.ref_name }} --draft=false
pypi_publish:
runs-on: ubuntu-latest
needs: final_publish
steps:
- name: Checkout
uses: actions/checkout@v3
- run: mkdir dist
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: dists
path: dist
- name: Upload
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TESTPYPI_TOKEN }}