Skip to content

Commit

Permalink
build for different python versions (#10)
Browse files Browse the repository at this point in the history
* build for different python versions

* try the m1 runner

* remove 3.8 from supported python versions

* exclude specific python target combinations

* fix python version name
  • Loading branch information
jpopesculian authored Mar 5, 2024
1 parent 3abafdc commit e3f81b8
Showing 1 changed file with 53 additions and 16 deletions.
69 changes: 53 additions & 16 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,85 @@ on:

jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
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

- release_for: linux-x86_64-gnu
- name: linux-x86_64-gnu
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: aqora
name: aqora-linux-x86_64-gnu.tar.gz
archive: tar.gz

# windows

- release_for: windows-x86_64-msvc
- name: windows-x86_64-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
bin: aqora.exe
name: aqora-windows-x86_64-msvc.zip
archive: zip

- release_for: windows-x86_64-gnu
- name: windows-x86_64-gnu
os: windows-latest
target: x86_64-pc-windows-gnu
bin: aqora.exe
name: aqora-windows-x86_64-gnu.zip
archive: zip

# macos

- release_for: macos-x86_64
- name: darwin-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: aqora
name: aqora-darwin-x86_64.tar.gz
archive: tar.gz

- release_for: macos-aarch64
os: macos-latest
- name: darwin-aarch64
os: macos-14
target: aarch64-apple-darwin
bin: aqora
name: aqora-darwin-aarch64.tar.gz
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
Expand All @@ -66,15 +101,17 @@ jobs:
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
if [[ "${{ matrix.platform.archive }}" == "zip" ]]; then
7z a ../../../$ARCHIVE_NAME ${{ matrix.platform.bin }}
else
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
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*"
if: startsWith( github.ref, 'refs/tags/v' )

0 comments on commit e3f81b8

Please sign in to comment.