Files
SwipedModSwitcher/.gitea/workflows/tag-release.yaml
T
s1d3sw1ped_bot 5b2affec8d
CI / Build (pull_request) Successful in 38s
CI / Lint (pull_request) Successful in 42s
CI / Test (pull_request) Successful in 59s
ci: Bump tag-release golangci-lint to v8
2026-09-02 02:23:24 +00:00

130 lines
3.3 KiB
YAML

name: Release versioned tag
on:
push:
tags:
- 'v*'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.13.2
args: --timeout=5m
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Get fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Get go dependencies
run: |
go mod tidy
- name: Test
run: go test -race -v -shuffle=on ./...
release:
name: Build versioned release
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install fyne command
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Install go dependencies
run: go mod tidy
- name: Build for linux
run: |
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
EXE: ""
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}.exe
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: ".exe"
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/
# Prefer built-in job token (Eva): gitea-release-action@v1 defaults to
# github.token / GITEA_TOKEN — no RELEASE_TOKEN / GIT_PACKAGES_TOKEN.
- name: Release binaries
uses: https://gitea.com/actions/gitea-release-action@v1
with:
files: |-
bin/**