-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.22 KB
/
Copy pathrelease.yaml
File metadata and controls
75 lines (65 loc) · 2.22 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
name: Release
on:
workflow_dispatch:
push:
branches:
- main
paths: [ VERSION ]
jobs:
release-cli:
runs-on: ubuntu-latest
permissions:
# So we can push tags
contents: write
# For keyless signing with cosign
id-token: write
env:
BUMPER_GROUP: bumper
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Set up Mise
uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
with:
install: true
cache: true
env: false
- name: Set up Bun
run: bun install --filter=.
- name: Prepare cache keys
run: mise run gha:pre-cache
- name: Cache Go modules and build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: ${{ env.GH_CACHE_GO_KEY }}
restore-keys: |
${{ env.GH_CACHE_GO_KEY }}
${{ env.GH_CACHE_GO_KEY_PARTIAL }}
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
- name: Set up env
run: |
notes_file="$(mktemp)"
bumper_version="$(mise bumper current)"
echo "BUMPER_GROUP_VERSION=$bumper_version" >> $GITHUB_ENV
echo "GORELEASER_CURRENT_TAG=v$bumper_version" >> $GITHUB_ENV
echo "RELEASE_NOTES_FILE=$notes_file" >> $GITHUB_ENV
mise bumper cat --version "$bumper_version" > "$notes_file"
- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${GORELEASER_CURRENT_TAG}"
git push origin "${GORELEASER_CURRENT_TAG}"
- name: Install cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
- name: goreleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
version: "~> v2"
args: --release-notes=${{ env.RELEASE_NOTES_FILE }} --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}