Skip to content

Commit 0ea13cf

Browse files
authored
Merge pull request #3 from ginkgobioworks/go-workflow
Create go.yml workflow
2 parents 6a23b51 + fe79a0b commit 0ea13cf

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/go.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
tags: [ "v*" ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
jobs:
14+
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version: '1.25'
24+
25+
- name: Vet
26+
run: go vet ./...
27+
28+
- name: Build
29+
env:
30+
GOOS: linux
31+
CGO_ENABLED: 0
32+
run: go build -v -ldflags "-s -w" ./...
33+
34+
- name: Test
35+
run: go test -v ./...
36+
37+
- name: Upload Binary
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: gcp-sa-credential-provider
41+
path: gcp-sa-credential-provider
42+
43+
release:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
if: github.ref_type == 'tag'
47+
steps:
48+
- name: Download Binary
49+
uses: actions/download-artifact@v5
50+
with:
51+
name: gcp-sa-credential-provider
52+
53+
- name: Release
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
files: gcp-sa-credential-provider

0 commit comments

Comments
 (0)