Skip to content

Commit

Permalink
Add github workflow for sidecar build
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfz0r committed Dec 8, 2023
1 parent 436cba6 commit efbc4a5
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on: push

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sidecar project
uses: actions/checkout@v4

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: "compile"
run: |
go version
go mod vendor
make test
make build-all
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Sign Windows binaries
run: >
docker run --rm
-e "CODESIGN_USER=$CODESIGN_USER"
-e "CODESIGN_PASS=$CODESIGN_PASS"
-e "CODESIGN_TOTP_SECRET=$CODESIGN_TOTP_SECRET"
-e "CODESIGN_CREDENTIAL_ID=$CODESIGN_CREDENTIAL_ID"
-v $(pwd):/home/jenkins
graylog/internal-codesigntool:latest
make sign-binaries
env:
CODESIGN_USER: ${{ secrets.CODESIGN_USER }}
CODESIGN_PASS: ${{ secrets.CODESIGN_PASS }}
CODESIGN_TOTP_SECRET: ${{ secrets.CODESIGN_TOTP_SECRET }}
CODESIGN_CREDENTIAL_ID: ${{ secrets.CODESIGN_CREDENTIAL_ID }}

- name: Build packages
run: docker run --rm -v $(pwd):/home/jenkins -u ubuntu:docker torch/jenkins-fpm-cook:latest make package-all

- name: Sign Windows Installer
run: >
docker run --rm
-e "CODESIGN_USER=$CODESIGN_USER"
-e "CODESIGN_PASS=$CODESIGN_PASS"
-e "CODESIGN_TOTP_SECRET=$CODESIGN_TOTP_SECRET"
-e "CODESIGN_CREDENTIAL_ID=$CODESIGN_CREDENTIAL_ID"
-v $(pwd):/home/jenkins
graylog/internal-codesigntool:latest
make sign-windows-installer
env:
CODESIGN_USER: ${{ secrets.CODESIGN_USER }}
CODESIGN_PASS: ${{ secrets.CODESIGN_PASS }}
CODESIGN_TOTP_SECRET: ${{ secrets.CODESIGN_TOTP_SECRET }}
CODESIGN_CREDENTIAL_ID: ${{ secrets.CODESIGN_CREDENTIAL_ID }}



0 comments on commit efbc4a5

Please sign in to comment.