-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 2.7 KB
/
build-publish.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build and Publish
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
jobs:
test-closures:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: |
set -eux
# Ensure all the checks can be built without internet
nix flake check --all-systems --max-jobs 0
nix build .#tarballs_json
cat result
nix build .#closures_json
cat result
nix build .#closures_nix
cat result
test-modules:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: |
set -eux
cd tests
rm -f flake.lock
nix flake lock
nix flake check
build-versions-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: |
set -eux
# Ensure all the checks can be built without internet
nix flake check --all-systems --max-jobs 0
nix build .#tarballs_json
cat result
nix build .#closures_json
cat result
nix build .#closures_nix
cat result
publish:
needs: [test-closures, test-modules, build-versions-nix]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: |
set -eux
nix build .#closures_nix
cat result
mkdir ./artifacts
cat './result' > './artifacts/universal'
nix eval -f ./artifacts/universal
- uses: DeterminateSystems/push-artifact-ids@main
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
with:
s3_upload_role: ${{ secrets.AWS_S3_UPLOAD_ROLE }}
bucket: ${{ secrets.AWS_S3_UPLOAD_BUCKET }}
directory: ./artifacts
ids_project_name: nix-upgrade
ids_binary_prefix: determinate-nix-versions.nix
- uses: "DeterminateSystems/flakehub-push@main"
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
visibility: "public"
name: "DeterminateSystems/nix"
tag: "${{ github.ref_name }}"