Build golem node pre-rel-v0.17.1-rc1 (testpypi) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build golem node | |
run-name: Build golem node ${{ github.event.inputs.release }} (${{ github.event.inputs.publish_artifacts }}) | |
on: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Golem Release tag (v0.15.0, pre-rel-v0.15.0-rc1)' | |
required: true | |
publish_artifacts: | |
description: 'Publish artifacts' | |
type: choice | |
required: true | |
options: | |
- build | |
- testpypi | |
- pypi | |
jobs: | |
build: | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows-static | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
OPENSSL_STATIC: 1 | |
defaults: | |
run: | |
working-directory: yagna | |
name: Build ${{ matrix.target }} | |
continue-on-error: ${{ matrix.experimental == 1 }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- runs-on: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
args: "--features static-openssl" | |
- runs-on: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
args: "--features static-openssl --compatibility musllinux_1_2" | |
musl: true | |
- runs-on: macos-13 | |
target: x86_64-apple-darwin | |
args: "--features static-openssl" | |
- runs-on: macos-14 | |
target: aarch64-apple-darwin | |
args: "--features static-openssl" | |
- runs-on: windows-latest | |
target: x86_64-pc-windows-msvc | |
- runs-on: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
args: "--features static-openssl --zig" | |
zig: true | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- uses: actions/checkout@v4 | |
with: | |
path: installer | |
- uses: actions/checkout@v4 | |
with: | |
repository: golemfactory/yagna | |
ref: "${{ github.event.inputs.release }}" | |
path: yagna | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ github.token }} | |
version: "24.x" | |
- uses: actions/setup-python@v5 | |
id: cp310 | |
with: | |
python-version: '3.10' | |
cache: pip | |
update-environment: true | |
- name: Install MUSL | |
if: ${{ matrix.musl }} | |
run: | | |
sudo apt-get install musl musl-tools | |
- name: Install Zig | |
if: ${{ matrix.zig }} | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: Install openssl | |
if: matrix.target == 'x86_64-pc-windows-msvc' | |
run: | | |
vcpkg install openssl:x64-windows-static | |
vcpkg integrate install | |
- run: | | |
${{ steps.cp310.outputs.python-path }} '${{ github.workspace }}/installer/gen-pypyoject.py' "${{ github.event.inputs.release }}" > pyproject.toml | |
- run: | | |
${{ steps.cp310.outputs.python-path }} -m pip install maturin | |
${{ steps.cp310.outputs.python-path }} -m pip install twine | |
- run: | | |
rustup target add ${{ matrix.target }} | |
- run: | | |
maturin build --release --target ${{ matrix.target }} -o dist ${{ matrix.args }} | |
- name: Upload wheels | |
if: github.event.inputs.publish_artifacts == 'build' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: yagna/dist | |
- name: Upload to test pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} | |
if: github.event.inputs.publish_artifacts == 'testpypi' | |
run: | | |
twine upload --repository testpypi dist/* | |
- name: Upload to pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
if: github.event.inputs.publish_artifacts == 'pypi' | |
run: | | |
twine upload dist/* |