Skip to content

Commit

Permalink
ci: use self-hosted agent for packaging
Browse files Browse the repository at this point in the history
WIP.
  • Loading branch information
jacderida committed Jul 12, 2024
1 parent 2d3e4c8 commit 8326d2a
Showing 1 changed file with 92 additions and 81 deletions.
173 changes: 92 additions & 81 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,94 +23,105 @@ env:
PAYMENT_FORWARD_PK: ${{ secrets.STABLE_REWARD_FORWARDING_PK }}

jobs:
build:
test:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: arm-unknown-linux-musleabi
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || inputs.branch }}
- uses: dtolnay/rust-toolchain@stable
# cargo-binstall will try and use pre-built binaries if they are available and also speeds up
# installing `cross`
- uses: cargo-bins/cargo-binstall@main
- shell: bash
run: cargo binstall --no-confirm just

- shell: bash
run: just build-release-artifacts "${{ matrix.target }}"
- uses: actions/upload-artifact@main
with:
name: safe_network-${{ matrix.target }}
path: |
artifacts
!artifacts/.cargo-lock
run: just build-release-artifacts "x86_64-unknown-linux-musl"

# This job isn't necessary, but it's useful for debugging the packaging process for the real release
# workflow, just in case any issues are ever encountered there.
package:
name: package artifacts
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || inputs.branch }}
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-pc-windows-msvc
path: artifacts/x86_64-pc-windows-msvc/release
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-unknown-linux-musl
path: artifacts/x86_64-unknown-linux-musl/release
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-apple-darwin
path: artifacts/x86_64-apple-darwin/release
- uses: actions/download-artifact@master
with:
name: safe_network-arm-unknown-linux-musleabi
path: artifacts/arm-unknown-linux-musleabi/release
- uses: actions/download-artifact@master
with:
name: safe_network-armv7-unknown-linux-musleabihf
path: artifacts/armv7-unknown-linux-musleabihf/release
- uses: actions/download-artifact@master
with:
name: safe_network-aarch64-unknown-linux-musl
path: artifacts/aarch64-unknown-linux-musl/release
- uses: cargo-bins/cargo-binstall@main
- shell: bash
run: cargo binstall --no-confirm just
- name: package artifacts
shell: bash
run: |
just package-release-assets "faucet"
just package-release-assets "nat-detection"
just package-release-assets "node-launchpad"
just package-release-assets "safe"
just package-release-assets "safenode"
just package-release-assets "safenode_rpc_client"
just package-release-assets "safenode-manager"
just package-release-assets "safenodemand"
just package-release-assets "sn_auditor"
- uses: actions/upload-artifact@main
with:
name: packaged_binaries
path: deploy
# build:
# name: build
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# include:
# - os: windows-latest
# target: x86_64-pc-windows-msvc
# - os: macos-latest
# target: x86_64-apple-darwin
# - os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# - os: ubuntu-latest
# target: arm-unknown-linux-musleabi
# - os: ubuntu-latest
# target: armv7-unknown-linux-musleabihf
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ inputs.tag || inputs.branch }}
# - uses: dtolnay/rust-toolchain@stable
# # cargo-binstall will try and use pre-built binaries if they are available and also speeds up
# # installing `cross`
# - uses: cargo-bins/cargo-binstall@main
# - shell: bash
# run: cargo binstall --no-confirm just
#
# - shell: bash
# run: just build-release-artifacts "${{ matrix.target }}"
# - uses: actions/upload-artifact@main
# with:
# name: safe_network-${{ matrix.target }}
# path: |
# artifacts
# !artifacts/.cargo-lock
#
# package:
# name: package artifacts
# runs-on: self-hosted
# needs: [build]
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ inputs.tag || inputs.branch }}
# - uses: actions/download-artifact@master
# with:
# name: safe_network-x86_64-pc-windows-msvc
# path: artifacts/x86_64-pc-windows-msvc/release
# - uses: actions/download-artifact@master
# with:
# name: safe_network-x86_64-unknown-linux-musl
# path: artifacts/x86_64-unknown-linux-musl/release
# - uses: actions/download-artifact@master
# with:
# name: safe_network-x86_64-apple-darwin
# path: artifacts/x86_64-apple-darwin/release
# - uses: actions/download-artifact@master
# with:
# name: safe_network-arm-unknown-linux-musleabi
# path: artifacts/arm-unknown-linux-musleabi/release
# - uses: actions/download-artifact@master
# with:
# name: safe_network-armv7-unknown-linux-musleabihf
# path: artifacts/armv7-unknown-linux-musleabihf/release
# - uses: actions/download-artifact@master
# with:
# name: safe_network-aarch64-unknown-linux-musl
# path: artifacts/aarch64-unknown-linux-musl/release
# - uses: cargo-bins/cargo-binstall@main
# - shell: bash
# run: cargo binstall --no-confirm just
# - name: package artifacts
# shell: bash
# run: |
# just package-release-assets "faucet"
# just package-release-assets "nat-detection"
# just package-release-assets "node-launchpad"
# just package-release-assets "safe"
# just package-release-assets "safenode"
# just package-release-assets "safenode_rpc_client"
# just package-release-assets "safenode-manager"
# just package-release-assets "safenodemand"
# just package-release-assets "sn_auditor"
# - uses: actions/upload-artifact@main
# with:
# name: packaged_binaries
# path: deploy

0 comments on commit 8326d2a

Please sign in to comment.