2021-12-30 04:29:18 +00:00
name : Build binaries
on :
push :
branches :
2024-03-13 12:45:28 +00:00
- main
2021-12-30 04:29:18 +00:00
pull_request :
workflow_dispatch :
2022-10-24 20:01:00 +00:00
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency :
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
cancel-in-progress : true
2022-10-07 15:43:56 +00:00
defaults :
run :
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell : bash
2022-03-16 19:42:28 +00:00
permissions :
contents : read
2021-12-30 04:29:18 +00:00
jobs :
build-binaries :
runs-on : ubuntu-latest
steps :
2024-03-22 20:32:23 +00:00
- name : Harden Runner
uses : step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with :
egress-policy : audit
2024-03-13 12:45:28 +00:00
- name : Install Go
uses : actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with :
go-version : ${{ vars.GO_VERSION }}
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
# Set the Node.js version
- name : Set up Node.js ${{ vars.NODE_VERSION }}
uses : actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with :
node-version : ${{ vars.NODE_VERSION }}
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Checkout Code
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : JS Dependency Cache
id : js-cache
uses : actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
with :
path : |
**/node_modules
# Use a separate cache for this from other JS jobs since we run the
# webpack steps and will have more to cache.
key : ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-node_version-${{ vars.NODE_VERSION }}
restore-keys : |
${{ runner.os }}-node_modules-
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Go Cache
id : go-cache
uses : actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
with :
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path : |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys : |
${{ runner.os }}-go-
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Install JS Dependencies
if : steps.js-cache.outputs.cache-hit != 'true'
run : make deps-js
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Install Go Dependencies
if : steps.go-cache.outputs.cache-hit != 'true'
run : make deps-go
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Generate static files
run : |
export PATH=$PATH:~/go/bin
make generate
2021-12-30 04:29:18 +00:00
2024-03-13 12:45:28 +00:00
- name : Build binaries
run : make
- uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with :
name : build
path : build/