-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (65 loc) · 2.11 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
name: tag
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+"
permissions:
contents: write
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Setup Git Crypt
run: sudo apt-get install -y git-crypt
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "^1.23.2"
- name: Fix file permissions
run: sudo chmod 0755 internal/arch/file/expect/test/permissions/0755.txt
- name: Lint Go files
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: -v --color=always --config=.rules/.golangci.yml ./...
- name: Run tests
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Run GoReleaser for pre-release
if: ${{ contains(github.ref_name, '-') }}
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "2.4.1"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.23.2"
- name: Log in to Docker Hub
if: ${{ !contains(github.ref_name, '-') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run GoReleaser for release
if: ${{ !contains(github.ref_name, '-') }}
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "2.4.1"
args: release --clean --release-notes=.changes/${{ github.ref_name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.23.2"