From 67b0d54936692305f910ce1e5b574144aa37e01c Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 17 Jan 2024 16:22:10 +0100 Subject: [PATCH] add a workflow to build the binary and use the GH action (#20) --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..88d2e2b9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: build-binary + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + permissions: + id-token: write + packages: write + contents: write + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + - name: Run Go build + run: | + go build -v -o demo-go ./... + - name: Sign artifact + uses: github-early-access/generate-build-provenance@main + with: + subject-path: '${{ github.workspace }}/demo-go' + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: demo-go-binary + path: demo-go