-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.71 KB
/
release-please.yml
File metadata and controls
97 lines (83 loc) · 2.71 KB
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
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: Verify release commit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Run linters
run: make lint
- name: Run unit tests
run: go test ./...
- name: Run race detector
run: go test -race ./...
- name: Verify module state
run: |
go mod verify
go mod tidy -diff
release-please:
needs: verify
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Release Please
id: release
uses: googleapis/release-please-action@v4
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v6
- name: Set up Go
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Warm Go module caches
if: ${{ steps.release.outputs.release_created }}
run: |
set -euo pipefail
MOD=github.com/${{ github.repository }}
VER=${{ steps.release.outputs.tag_name }}
curl -sSfL "https://proxy.golang.org/${MOD}/@v/${VER}.info" || true
curl -sSfL "https://sum.golang.org/lookup/${MOD}@${VER}" || true
curl -sSfL "https://pkg.go.dev/${MOD}@${VER}" > /dev/null || true
- name: Create release summary
if: ${{ steps.release.outputs.release_created }}
run: |
{
echo "## Release ${{ steps.release.outputs.tag_name }}"
echo
echo "- GitHub release: https://github.com/${{ github.repository }}/releases/tag/${{ steps.release.outputs.tag_name }}"
echo "- pkg.go.dev: https://pkg.go.dev/github.com/bubustack/core@${{ steps.release.outputs.tag_name }}"
echo
echo '```bash'
echo "go get github.com/bubustack/core@${{ steps.release.outputs.tag_name }}"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"