-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 2.33 KB
/
test_release.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: test_release
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
enable_debug_tmate:
required: false
type: boolean
default: false
permissions:
contents: write
issues: write
pull-requests: write
jobs:
test:
name: test
strategy:
matrix:
os:
- ubuntu-22.04
- windows-2022
- macos-12
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: (debug) Setup tmate session
if: ${{ inputs.enable_debug_tmate }}
uses: mxschmitt/action-tmate@v3
- name: test
run: |
make test
- name: test (different LOCALE)
if: runner.os == 'Linux'
run: |
locale-gen zh_CN.UTF-8
LC_ALL='zh_CN.UTF-8' make test
release:
if: (github.ref == 'refs/heads/main') && (github.repository_owner == 'mikesmithgh')
runs-on: ubuntu-22.04
name: release
needs:
- test
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false # see https://github.com/semantic-release/semantic-release/discussions/2557
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Setup GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
install-only: true
- name: (debug) Setup tmate session
if: ${{ inputs.enable_debug_tmate }}
uses: mxschmitt/action-tmate@v3
- name: Semantic Release
run: |
npm install @semantic-release/git @semantic-release/changelog @semantic-release/exec -D
npx semantic-release
env:
GH_TOKEN: ${{ secrets.GIT_PROMPT_STRING_CI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GIT_PROMPT_STRING_CI_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_GIT_PROMPT_STRING_CI_TOKEN }}