Skip to content

Commit

Permalink
fix: build with nix command
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyg committed Oct 9, 2023
1 parent ddf206a commit 9de1ca8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,24 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz tar.zst
- target: x86_64-apple-darwin
archive: zip
platform:
- system: x86_64-darwin
- system: aarch64-darwin
- system: x86_64-linux
steps:
- uses: actions/checkout@v4
with:
repository: holochain/holochain
ref: ${{ github.event.client_payload.ref }}
- name: Compile and release
uses: rust-build/[email protected]
- name: "Build"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
UPLOAD_MODE: none
- name: Upload artifact
system: ${{ matrix.platform.system }}
run: |
nix develop --command bash -c "cargo build --target ${{ matrix.platform.system }} --release --bin holochain --bin hc --bin lair-keystore"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Holochain ${{ github.event.client_payload.ref }}
name: Holochain Prebuilt Binaries - ${{ github.event.client_payload.ref }}
path: |
${{ steps.compile.outputs.BUILT_ARCHIVE }}
${{ steps.compile.outputs.BUILT_CHECKSUM }}
13 changes: 9 additions & 4 deletions trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@ import {Octokit} from "octokit";
import 'dotenv/config';

const RELEASE_NAME = process.argv[3];
const RELEASE_REF = `tags/${RELEASE_NAME}`;

async function main() {
if(!RELEASE_NAME) {
console.error("Error: Set a release name");
process.exit();
}

const octokit = new Octokit({
auth: process.env.GITHUB_AUTH_TOKEN
})

try {
let res = await octokit.request('POST /repos/{owner}/{repo}/dispatches', {
owner: 'buildyourwebapp',
repo: 'holochain-prebuild-binaries',
repo: 'holochain-prebuilt-binaries',
event_type: 'new_holochain_release',
client_payload: {
ref: RELEASE_REF
ref: RELEASE_NAME
},
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
});
console.log("Triggered build-release workflow");
} catch(e) {
//@ts-ignore
console.error(`Error: **${(e as AxiosError).response.statusText}** ${(e as AxiosError).response.data}`);
console.error(e);
}
}

Expand Down

0 comments on commit 9de1ca8

Please sign in to comment.