forked from salesforce/p4-fusion
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (107 loc) · 3.94 KB
/
Copy pathnix-build-and-upload.yaml
File metadata and controls
110 lines (107 loc) · 3.94 KB
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
110
name: nix_p4-fusion
on:
push:
branches:
- master
pull_request:
jobs:
x86_64-darwin:
name: Build p4-fusion x86_64-darwin
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
- name: '🔓 Authenticate to Google Cloud'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.CTAGS_GCP_SERVICE_ACCOUNT }}
- name: Run `nix build`
run: |
nix build .#p4-fusion_openssl1_1-static
- name: Sign the binary
# signing in ./result/bin will cause a cache miss on next invocation
run: |
mkdir -p dist
cp -L ./result/bin/p4-fusion* ./dist/
sudo codesign --force -s - ./dist/p4-fusion*
- name: Rename and prepare for upload
run: |
cd ./dist/ && ls | xargs -I{} mv {} "{}.$(git rev-parse --short HEAD)"
- name: Show hash of p4-fusion
run: |
shasum -a 256 ./dist/p4-fusion*
- uses: google-github-actions/upload-cloud-storage@v1
# github.head_ref is only available for pull requests
# if the event type is not pull_requet we have to use github.ref_name
if: ${{ github.ref_name == 'master' }}
with:
path: './dist/'
destination: 'p4-fusion/x86_64-darwin/'
glob: 'p4-fusion*'
aarch64-darwin:
name: Build p4-fusion aarch64-darwin
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
- name: '🔓 Authenticate to Google Cloud'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.CTAGS_GCP_SERVICE_ACCOUNT }}
- name: Run `nix build`
run: |
nix build .#p4-fusion_openssl1_1-static
- name: Sign the binary
# signing in ./result/bin will cause a cache miss on next invocation
run: |
mkdir -p dist
cp -L ./result/bin/p4-fusion* ./dist/
sudo codesign --force -s - ./dist/p4-fusion*
- name: Rename and prepare for upload
run: |
cd ./dist/ && ls | xargs -I{} mv {} "{}.$(git rev-parse --short HEAD)"
- name: Show hash of p4-fusion
run: |
shasum -a 256 ./dist/p4-fusion*
- uses: google-github-actions/upload-cloud-storage@v1
# github.head_ref is only available for pull requests
# if the event type is not pull_requet we have to use github.ref_name
if: ${{ github.ref_name == 'master' }}
with:
path: './dist/'
destination: 'p4-fusion/aarch64-darwin/'
glob: 'p4-fusion*'
x86_64-linux:
name: Build p4-fusion x86_64-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
- name: '🔓 Authenticate to Google Cloud'
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.CTAGS_GCP_SERVICE_ACCOUNT }}
- name: Run `nix build`
run: |
nix build .#p4-fusion_openssl1_1-static
- name: Rename and prepare for upload
run: |
mkdir -p dist
cp -R -L ./result/bin/p4-fusion* dist/
cd dist/ && ls | xargs -I{} mv {} "{}.$(git rev-parse --short HEAD)"
- name: Show hash of p4-fusion
run: |
shasum -a 256 ./dist/p4-fusion*
- uses: google-github-actions/upload-cloud-storage@v1
# github.head_ref is only available for pull requests
# if the event type is not pull_requet we have to use github.ref_name
if: ${{ github.ref_name == 'master' }}
with:
path: './dist/'
destination: 'p4-fusion/x86_64-linux/'
glob: 'p4-fusion*'
report_failure:
needs: [aarch64-darwin, x86_64-darwin, x86_64-linux]
if: ${{ failure() }}
uses: sourcegraph/workflows/.github/workflows/report-job-failure.yml@main
secrets: inherit