Skip to content

build for different python versions #30

build for different python versions

build for different python versions #30

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
workflow_dispatch:
jobs:
release:
name: Release - ${{ matrix.platform.name }} py${{ matrix.python_version.major}}.${{ matrix.python_version.minor }}
strategy:
matrix:
python_version:
- major: 3
minor: 8
- major: 3
minor: 9
- major: 3
minor: 10
- major: 3
minor: 11
- major: 3
minor: 12
platform:
# linux
- name: linux-x86_64-gnu
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: aqora
archive: tar.gz
# windows
- name: windows-x86_64-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
bin: aqora.exe
archive: zip
- name: windows-x86_64-gnu
os: windows-latest
target: x86_64-pc-windows-gnu
bin: aqora.exe
archive: zip
# macos
- name: darwin-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: aqora
archive: tar.gz
- name: darwin-aarch64
os: macos-14
target: aarch64-apple-darwin
bin: aqora
archive: tar.gz
exclude:
- platform:
name: darwin-aarch64
os: macos-14
target: aarch64-apple-darwin
bin: aqora
archive: tar.gz
python_version:
major: 3
minor: 8
- platform:
name: darwin-aarch64
os: macos-14
target: aarch64-apple-darwin
bin: aqora
archive: tar.gz
python_version:
major: 3
minor: 9
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python_version.major }}.${{ matrix.python_version.minor }}"
- uses: Swatinem/rust-cache@v2
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ matrix.platform.target }}
args: "--release"
strip: true
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.archive }}" == "zip" ]]; then
7z a ../../../$ARCHIVE_NAME ${{ matrix.platform.bin }}
else
tar czvf ../../../$ARCHIVE_NAME ${{ matrix.platform.bin }}
fi
cd -
env:
ARCHIVE_NAME: aqora-${{ matrix.platform.name }}-py${{ matrix.python_version.major }}_${{ matrix.python_version.minor }}.${{ matrix.platform.archive }}
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
if: startsWith( github.ref, 'refs/tags/v' )
with:
draft: true
files: "aqora*"