Skip to content

Commit 5bee69f

Browse files
committed
build: enable github actions
Signed-off-by: Phil Adams <[email protected]>
1 parent f101f2f commit 5bee69f

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

.github/workflows/build.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# This workflow will build and unit test the project.
2+
# If the workflow is running on the "main" branch, then
3+
# semantic-release is also run to create a new release (if
4+
# warranted by the new commits being built).
5+
6+
name: Build/Test/Publish
7+
8+
on:
9+
push:
10+
branches: ['**']
11+
pull_request:
12+
branches: ['**']
13+
workflow_dispatch:
14+
# Allow workflow to be triggered manually.
15+
16+
jobs:
17+
detect-secrets:
18+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
19+
name: Detect-Secrets
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.12
30+
31+
- name: Install detect-secrets
32+
run: |
33+
pip install --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets"
34+
35+
- name: Run detect-secrets
36+
run: |
37+
detect-secrets scan --update .secrets.baseline
38+
detect-secrets -v audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline
39+
40+
build:
41+
needs: detect-secrets
42+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
43+
name: Build/Test (Go v${{ matrix.go-version }})
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
go-version: ['1.21', '1.22', '1.23']
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Go v${{ matrix.go-version }}
54+
uses: actions/setup-go@v5
55+
with:
56+
go-version: ${{ matrix.go-version }}
57+
58+
- name: Install dependencies
59+
run: |
60+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.61.0
61+
golangci-lint version
62+
go install golang.org/x/tools/cmd/goimports@latest
63+
64+
- name: Build/Test Project
65+
run: make travis-ci
66+
67+
publish-release:
68+
needs: build
69+
if: "github.ref_name == 'main' && github.event_name != 'pull_request'"
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@v4
75+
with:
76+
persist-credentials: false
77+
78+
- name: Setup Node.js
79+
uses: actions/setup-node@v4
80+
with:
81+
node-version: 22
82+
83+
- name: Set up Python
84+
uses: actions/setup-python@v5
85+
with:
86+
python-version: 3.12
87+
88+
- name: Install Deployment Tools
89+
run: |
90+
pip install bump-my-version
91+
npm install
92+
93+
- name: Run semantic-release
94+
env:
95+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
96+
run: npm run semantic-release

0 commit comments

Comments
 (0)