-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (57 loc) · 1.64 KB
/
build.yml
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
name: Build and Test
on:
release:
types: [ published ]
push:
pull_request:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
package: [ "age-plugin-op-linux-arm64", "age-plugin-op-linux-arm32", "age-plugin-op-linux-amd64",
"age-plugin-op-darwin-amd64", "age-plugin-op-darwin-arm64" ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
# Disable diagnostics
diagnostic-endpoint: ""
- name: Build
run: nix build .#${{ matrix.package }} -L
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}
path: result/**/age-plugin-op*
if-no-files-found: error
upload:
name: Upload Release Binaries
if: github.event_name == 'release'
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Gather Binaries
run: |
ls -R artifacts
find artifacts -type f -name "age-plugin-op"
- name: Upload Release Artifacts
run: gh release upload "$GITHUB_REF_NAME" age-plugin-op-*
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}