63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
name: Release versioned tag
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
name: Build versioned release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
check-latest: true
|
|
cache: true
|
|
|
|
- name: Install go dependencies
|
|
run: go mod tidy
|
|
|
|
- name: Lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
args: -D errcheck
|
|
version: latest
|
|
|
|
- name: Test
|
|
run: go test -race -v -shuffle=on ./...
|
|
|
|
- name: Build for linux
|
|
run: |
|
|
go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
|
env:
|
|
VERSION: ${{github.ref_name}}
|
|
BUILD: ${{github.run_number}}
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
EXE: ""
|
|
|
|
- name: Build for windows
|
|
run: |
|
|
go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
|
env:
|
|
VERSION: ${{github.ref_name}}
|
|
BUILD: ${{github.run_number}}
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
EXE: ".exe"
|
|
|
|
- name: Release binaries
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: 'latest'
|
|
args: release --clean
|
|
env:
|
|
GITEA_TOKEN: ${{secrets.RELEASE_TOKEN}} |