-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of #2 It build the binary and archive it in workflow artifacts
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev-workflow | ||
pull_request: | ||
|
||
jobs: | ||
configure: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 | ||
- name: Set matrix data | ||
id: set-matrix | ||
run: | | ||
echo 'matrix<<EOF' >> "$GITHUB_OUTPUT" | ||
echo "$(cat ./tools/ci/build-matrix.json)" >> "$GITHUB_OUTPUT" | ||
echo EOF >> "$GITHUB_OUTPUT" | ||
build: | ||
name: "Build [${{ matrix.os }} - ${{ matrix.platform }}]" | ||
needs: configure | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.configure.outputs.matrix) }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 | ||
- name: Build | ||
run: | | ||
nix-shell --pure --run '${{ github.workspace }}/tools/ci/build.sh ${{ matrix.platform }}' | ||
nix-shell --pure --run 'echo "$(bazel info output_path)/filc" > path.txt' | ||
- name: Get binary path | ||
id: path | ||
run: echo "path=$(cat path.txt)" >> "$GITHUB_OUTPUT" | ||
- name: Archive binary | ||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | ||
with: | ||
name: "filc-${{ matrix.platform }}" | ||
path: ${{ steps.path.outputs.path }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$1" ]; then | ||
platform="" | ||
else | ||
platform="--platforms=//tools/bazel/platform:$1" | ||
fi | ||
|
||
bazel build -c opt $platform //:filc |