Repository navigation
92 lines (78 loc) · 2.35 KB
/
Copy pathrelease.yml
File metadata and controls
92 lines (78 loc) · 2.35 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
name: 🚀 Release
on:
push:
branches:
- main
workflow_dispatch:
permissions: {}
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
tagpr:
name: 🔖 Release a New Version
permissions:
contents: read
runs-on: ubuntu-slim
environment:
name: Release
deployment: false
timeout-minutes: 1
outputs:
tag: ${{ steps.tagpr.outputs.tag }}
steps:
- name: 💳 Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.CLIENT_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: 🚚 Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: 🔐 Set up Credential Helper
run: gh auth setup-git
env:
GH_HOST: github.com
- name: 🔖 Release a new version
id: tagpr
uses: Songmu/tagpr@1fcd7292d1fe8ea9a8313eef46b8d80b7a15d227 # v1.21.3
with:
config: .github/tagpr.ini
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
release:
name: 🛠️ Build and Release
permissions:
contents: write
needs: tagpr
if: ${{ needs.tagpr.outputs.tag != '' }}
runs-on: Ubuntu-24.04
timeout-minutes: 2
steps:
- name: 🚚 Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: 🐹 Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: false
- name: 📦 Install dependencies
run: go mod download
- name: 🛠️ Build and release
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}