install-release-all #6
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
on: | |
repository_dispatch: | |
types: [install-release-all] | |
jobs: | |
build: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: true | |
matrix: | |
platforms: | |
- host: macos-11 | |
target: aarch-apple-darwin | |
- host: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
- host: windows-2019 | |
target: x86_64-pc-windows-msvc | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
runs-on: ${{ matrix.platforms.host }} | |
steps: | |
- name: install Rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
override: true | |
toolchain: stable | |
- name: install Go stable | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
- name: install dependencies (ubuntu only) | |
if: matrix.platforms.host == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential libssl-dev | |
- name: Create build output dir | |
run: | | |
mkdir binaries | |
- name: Build binaries (Windows only) | |
if: matrix.platforms.host == 'windows-2019' | |
run: | | |
cargo install --version ${{ github.event.client_payload.lair_version }} lair_keystore | |
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition | |
Copy-Item $LkPath -Destination binaries/lair-keystore-v${{ github.event.client_payload.lair_version }}-${{ matrix.platforms.target }}.exe | |
cargo install holochain --version ${{ github.event.client_payload.holochain_version }} --features sqlite-encrypted | |
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition | |
Copy-Item $HcPath -Destination binaries/holochain-v${{ github.event.client_payload.holochain_version }}-${{ matrix.platforms.target }}.exe | |
cargo install holochain_cli --version ${{ github.event.client_payload.hc_version }} | |
$HcPath = Get-Command hc | Select-Object -ExpandProperty Definition | |
Copy-Item $HcPath -Destination binaries/hc-v${{ github.event.client_payload.hc_version }}-${{ matrix.platforms.target }}.exe | |
- name: Build binaries (Linux & Macos only) | |
if: matrix.platforms.host == 'macos-13' || matrix.platforms.host == 'ubuntu-20.04' | |
run: | | |
cargo install --version ${{ github.event.client_payload.lair_version }} lair_keystore | |
LAIR_PATH=$(which lair-keystore) | |
cp $LAIR_PATH binaries/lair-keystore-v${{ github.event.client_payload.lair_version }}-${{ matrix.platforms.target }} | |
cargo install holochain --version ${{ github.event.client_payload.holochain_version }} --features sqlite-encrypted | |
HOLOCHAIN_PATH=$(which holochain) | |
cp $HOLOCHAIN_PATH binaries/holochain-v${{ github.event.client_payload.holochain_version }}-${{ matrix.platforms.target }} | |
cargo install holochain_cli --version ${{ github.event.client_payload.hc_version }} | |
HC_PATH=$(which hc) | |
cp $HC_PATH binaries/hc-v${{ github.event.client_payload.hc_version }}-${{ matrix.platforms.target }} | |
- name: Rename artifact | |
run: | | |
mv binaries/lair-keystore binaries/lair-keystore-${{ matrix.platforms.target }} | |
mv binaries/holochain binaries/holochain-${{ matrix.platforms.target }} | |
mv binaries/hc binaries/hc-${{ matrix.platforms.target }} | |
- name: Upload artifacts (unix paths) | |
if: matrix.platforms.host == 'ubuntu-20.04' || matrix.platforms.host == 'macos-11' | |
uses: actions/upload-artifact@v3 | |
with: | |
path: | | |
binaries/lair-keystore-* | |
binaries/holochain-* | |
binaries/hc-* | |
if-no-files-found: error | |
release: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifact/lair-keystore-*" | |
name: Prebuilt Binaries for Holochain ${{ github.event.client_payload.holochain_version }} | |
body: "Holochain, Holochain CLI & Lair Keystore binaries compatible with holochain ${{ github.event.client_payload.holochain_version }}" | |
tag: "${{ github.event.client_payload.holochain_version }}" | |
draft: true | |
prerelease: false | |
skipIfReleaseExists: true |