-
Notifications
You must be signed in to change notification settings - Fork 45
94 lines (82 loc) · 2.66 KB
/
wf_build_artifacts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
on:
workflow_call:
inputs:
NAME:
type: string
required: true
GIT_REF:
type: string
required: false
VERSION:
type: string
required: true
PATH:
type: string
default: "."
required: false
DOCKER:
type: boolean
required: true
jobs:
artifacts:
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: write
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-arm64-22.04-2cores]
fail-fast: true
runs-on: ${{ matrix.os }}
timeout-minutes: 180
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.GIT_REF }}
- uses: cachix/install-nix-action@v30
with:
install_url: "https://releases.nixos.org/nix/nix-2.22.3/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- uses: DeterminateSystems/magic-nix-cache-action@v8
with:
diagnostic-endpoint: ""
use-flakehub: false
- name: Compute common env vars
id: vars
run: |
echo "VERSION=$(make get-version VER=${{ inputs.VERSION }})" >> $GITHUB_OUTPUT
echo "ARCHITECTURE=$(uname -m)" >> $GITHUB_OUTPUT
- name: "Build artifact"
run: |
make build
zip -r result.zip result
- name: "Push artifact to artifact repository"
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.NAME }}-artifact-${{ steps.vars.outputs.ARCHITECTURE }}-${{ steps.vars.outputs.VERSION }}
path: result/bin/hasura-storage
retention-days: 7
- name: "Build docker image"
run: |
make build-docker-image
if: ${{ ( inputs.DOCKER ) }}
- name: "Push docker image to artifact repository"
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.NAME }}-docker-image-${{ steps.vars.outputs.ARCHITECTURE }}-${{ steps.vars.outputs.VERSION }}
path: result
retention-days: 7
if: ${{ ( inputs.DOCKER ) }}
# - name: "Cache build environment"
# run: |
# # DEPENDENCIES=($(nix-store --query --requisites --include-outputs ${{ steps.verify-build.outputs.DERIVATION_PATH }}))
# nix copy --to http://127.0.0.1:37515 "${DEPENDENCIES[@]}" || exit 0