Skip to content

Commit ea2ed9b

Browse files
committed
Add github workflow for sidecar build
1 parent 436cba6 commit ea2ed9b

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/pr-build.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
on: push
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout sidecar project
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Go environment
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version: '1.21'
18+
19+
- name: "compile"
20+
run: |
21+
go version
22+
go mod vendor
23+
make test
24+
make build-all
25+
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USER }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Sign Windows binaries
33+
run: >
34+
docker run --rm
35+
-e "CODESIGN_USER=$CODESIGN_USER"
36+
-e "CODESIGN_PASS=$CODESIGN_PASS"
37+
-e "CODESIGN_TOTP_SECRET=$CODESIGN_TOTP_SECRET"
38+
-e "CODESIGN_CREDENTIAL_ID=$CODESIGN_CREDENTIAL_ID"
39+
-v $(pwd):/home/jenkins
40+
graylog/internal-codesigntool:latest
41+
make sign-binaries
42+
env:
43+
CODESIGN_USER: ${{ secrets.CODESIGN_USER }}
44+
CODESIGN_PASS: ${{ secrets.CODESIGN_PASS }}
45+
CODESIGN_TOTP_SECRET: ${{ secrets.CODESIGN_TOTP_SECRET }}
46+
CODESIGN_CREDENTIAL_ID: ${{ secrets.CODESIGN_CREDENTIAL_ID }}
47+
48+
- name: Build packages
49+
run: docker run --rm -v $(pwd):/home torch/jenkins-fpm-cook-root:latest sh -c "cd /home && make package-all"
50+
51+
- name: Sign Windows Installer
52+
run: >
53+
docker run --rm
54+
-e "CODESIGN_USER=$CODESIGN_USER"
55+
-e "CODESIGN_PASS=$CODESIGN_PASS"
56+
-e "CODESIGN_TOTP_SECRET=$CODESIGN_TOTP_SECRET"
57+
-e "CODESIGN_CREDENTIAL_ID=$CODESIGN_CREDENTIAL_ID"
58+
-v $(pwd):/home/jenkins
59+
graylog/internal-codesigntool:latest
60+
make sign-windows-installer
61+
env:
62+
CODESIGN_USER: ${{ secrets.CODESIGN_USER }}
63+
CODESIGN_PASS: ${{ secrets.CODESIGN_PASS }}
64+
CODESIGN_TOTP_SECRET: ${{ secrets.CODESIGN_TOTP_SECRET }}
65+
CODESIGN_CREDENTIAL_ID: ${{ secrets.CODESIGN_CREDENTIAL_ID }}
66+
67+
- name: Chocolatey Pack
68+
run: >
69+
docker build -f docker/Dockerfile.chocolatey docker/ -t local/chocolatey &&
70+
docker run --rm -v $(pwd):/root local/chocolatey make package-chocolatey
71+
72+
- name: Create checksums
73+
run: cd dist/pkg && sha256sum * | tee CHECKSUMS-SHA256.txt
74+
75+
- name: Archive artifacts
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: sidecar-artifacts
79+
retention-days: 14
80+
path: |
81+
dist/pkg

0 commit comments

Comments
 (0)