-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.64 KB
/
test-on-push.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Test
permissions:
id-token: write # Enable OIDC
pull-requests: write
contents: write
packages: write
issues: write
on:
push:
pull_request:
branches:
- main
jobs:
build:
name: Test on ${{ matrix.gover }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
gover:
- "1.21"
- "1.22"
env:
GOVER: ${{ matrix.gover }}
GOLANGCILINT_VER: v1.55.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
- name: Tidy
run: make tidy
- name: Test
run: make test
# - name: Cover
# uses: codecov/codecov-action@v4
- name: Lint
uses: golangci/golangci-lint-action@v3.3.1
with:
version: ${{ env.GOLANGCILINT_VER }}
skip-cache: true
args: --timeout=10m0s
- name: Run go mod tidy check diff
run: make modtidy check-diff
- name: Run go mod tidy
run: make modtidy
prerelease:
runs-on: ubuntu-latest
needs:
- build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Run Release
uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ secrets.GIT_RELEASE_TOKEN }} # <-- PAT secret name
# - name: tag major and minor versions
# if: ${{ steps.release.outputs.release_created }}
# run: |
# git config user.name github-actions[bot]
# git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git"
# git tag -d v${{ steps.release.outputs.major }} || true
# git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
# git push origin :v${{ steps.release.outputs.major }} || true
# git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
# git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
# git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
# git push origin v${{ steps.release.outputs.major }}
# git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}