Skip to content

Commit

Permalink
ci go assets build step
Browse files Browse the repository at this point in the history
  • Loading branch information
ramfox committed Dec 1, 2023
1 parent 0794feb commit 9e5736b
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 46 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/go-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Python Wheels

on:
push:
branches:
- go_assets
pull_request:

jobs:
manylinux2014:
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
strategy:
matrix:
name: [ubuntu-latest, ubuntu-arm-latest]
include:
- name: ubuntu-latest
python: 3.11
os: ubuntu-latest
release-os: manylinux2014
release-arch: x86_64
container: quay.io/pypa/manylinux2014_x86_64
runner: [ubuntu-latest]
- name: ubuntu-arm-latest
python: 3.11
os: ubuntu-latest
release-os: manylinux2014
release-arch: aarch64
container: quay.io/pypa/manylinux2014_aarch64
runner: [self-hosted, linux, ARM64]
steps:
- uses: actions/checkout@v3
- name: Install stable rust
run: curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
- name: Install maturin & uniffi-bindgen
run: |
/opt/python/cp311-cp311/bin/pip install maturin uniffi-bindgen
- name: Build wheel
run: |
source $HOME/.cargo/env
PATH=/opt/python/cp311-cp311/bin:$PATH
export PATH
maturin build --release --manylinux 2014
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: target/wheels/*.whl

osx:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
name: [macOS-latest, macOS-arm-latest]
include:
- name: macOS-latest
python: 3.11
os: macOS-latest
release-os: darwin
release-arch: x86_64
runner: [macOS-latest]
- name: macOS-arm-latest
python: 3.11
os: macOS-latest
release-os: darwin
release-arch: aarch64
runner: [self-hosted, macOS, ARM64]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install maturin & uniffi-bindgen
run: |
pip install maturin uniffi-bindgen
- name: Build wheel
run: |
maturin build --release
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: target/wheels/*.whl

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install maturin & uniffi-bindgen
run: |
pip install maturin uniffi-bindgen
- name: Build wheel
run: |
maturin build --release
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheels-windows-x86_64
path: target/wheels/*.whl

92 changes: 46 additions & 46 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Wheels
name: Go Assets

on:
push:
Expand All @@ -15,14 +15,12 @@ jobs:
name: [ubuntu-latest, ubuntu-arm-latest]
include:
- name: ubuntu-latest
python: 3.11
os: ubuntu-latest
release-os: manylinux2014
release-arch: x86_64
container: quay.io/pypa/manylinux2014_x86_64
runner: [ubuntu-latest]
- name: ubuntu-arm-latest
python: 3.11
os: ubuntu-latest
release-os: manylinux2014
release-arch: aarch64
Expand All @@ -32,20 +30,21 @@ jobs:
- uses: actions/checkout@v3
- name: Install stable rust
run: curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
- name: Install maturin & uniffi-bindgen
run: |
/opt/python/cp311-cp311/bin/pip install maturin uniffi-bindgen
- name: Build wheel
run: |
source $HOME/.cargo/env
PATH=/opt/python/cp311-cp311/bin:$PATH
export PATH
maturin build --release --manylinux 2014
- name: Upload wheel
- name: Install uniffi-bindgen-go
run: cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.0+v0.25.0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'
- name: Build
run: ./build_go_linux.sh
- name: Tar assets
run: tar -czvf iroh-go.tar.gz ./iroh-go/iroh
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: target/wheels/*.whl
name: iroh-go-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: iroh-go.tar.gz

osx:
runs-on: ${{ matrix.runner }}
Expand All @@ -68,38 +67,39 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install maturin & uniffi-bindgen
run: |
pip install maturin uniffi-bindgen
- name: Build wheel
run: |
maturin build --release
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: target/wheels/*.whl

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
- name: Setup Go
uses: actions/setup-go@v3
with:
python-version: '3.11'
- name: Install maturin & uniffi-bindgen
run: |
pip install maturin uniffi-bindgen
- name: Build wheel
run: |
maturin build --release
- name: Upload wheel
go-version: '1.21.x'
- name: Install uniffi-bindgen-go
run: cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.0+v0.25.0
- name: Build
run: ./build_go_linux.sh
- name: Tar assets
run: tar -czvf iroh-go.tar.gz ./iroh-go/iroh
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: wheels-windows-x86_64
path: target/wheels/*.whl
name: iroh-go-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: iroh-go.tar.gz

# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - uses: actions/setup-python@v4
# with:
# python-version: '3.11'
# - name: Install maturin & uniffi-bindgen
# run: |
# pip install maturin uniffi-bindgen
# - name: Build wheel
# run: |
# maturin build --release
# - name: Upload wheel
# uses: actions/upload-artifact@v3
# with:
# name: wheels-windows-x86_64
# path: target/wheels/*.whl

0 comments on commit 9e5736b

Please sign in to comment.