-
Notifications
You must be signed in to change notification settings - Fork 39
25 lines (25 loc) · 1.02 KB
/
Copy pathrelease.yml
File metadata and controls
25 lines (25 loc) · 1.02 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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # v1.2.3のようなGitタグがプッシュされたら起動
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.ref_name }} # v1.2.3のような値をGitタグから取得
permissions:
contents: write # リリースノートの作成に必要なパーミッション
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: | # リリース対象アプリケーションのビルド
go build -ldflags "-X main.version=${VERSION}" \
-o "${RUNNER_TEMP}/example" go/example/main.go
- run: | # リリースノートの作成とアセットのアップロード
gh release create "${VERSION}" --title "${VERSION}" --generate-notes
gh release upload "${VERSION}" "${RUNNER_TEMP}/example"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}