Skip to content

Commit a6234d8

Browse files
committed
chore: Add gh action and update golang to 1.23
1 parent ef65c14 commit a6234d8

4 files changed

Lines changed: 110 additions & 1 deletion

File tree

‎.github/workflows/go.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ "main", "dev" ]
6+
pull_request:
7+
branches: [ "main", "dev" ]
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
15+
build:
16+
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.draft)
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
go: ['1.23', '1.24', '1.25', '1.26']
21+
os: [ 'linux', 'windows', 'darwin' ]
22+
arch: [ 'amd64', 'arm64' ]
23+
outputs:
24+
commit-hash: ${{ steps.get_commit.outputs.commit }}
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v6
31+
with:
32+
go-version: ${{ matrix.go }}
33+
34+
- name: Build
35+
env:
36+
GOOS: ${{ matrix.os }}
37+
GOARCH: ${{ matrix.arch }}
38+
run: go build -v ./...
39+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
branches: [ "main", "dev" ]
6+
pull_request:
7+
branches: [ "main", "dev" ]
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v6
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version: 1.26
23+
24+
- name: Run golangci-lint
25+
uses: golangci/golangci-lint-action@v9
26+
with:
27+
version: latest
28+
skip-cache: true
29+
skip-save-cache: true
30+
31+
- name: Upload lint results
32+
uses: actions/upload-artifact@v7
33+
if: failure()
34+
with:
35+
name: golangci-lint-results
36+
path: golangci-lint-report.txt
37+

‎.github/workflows/release.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v6
22+
with:
23+
go-version: 1.26
24+
25+
- name: Release
26+
uses: goreleaser/goreleaser-action@v7
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/GoToolSharing/vbkview
22

3-
go 1.22
3+
go 1.23.0
44

55
require (
66
github.com/GoToolSharing/vbktoolkit v0.0.0-20260420090906-925abf074c28

0 commit comments

Comments
 (0)