-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.13 KB
/
cli-release.yaml
File metadata and controls
47 lines (40 loc) · 1.13 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
name: Release CLI
on:
push:
tags:
- "cli/v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: cli/go.mod
cache-dependency-path: cli/go.sum
- name: Extract version from tag
id: version
run: |
# Strip the "cli/" prefix from the tag to get the semver (e.g. cli/v1.2.3 -> v1.2.3)
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#cli/}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true
version: "~> v2"
- name: Run GoReleaser
working-directory: cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }}
run: goreleaser release --clean