-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (42 loc) · 1.35 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag (i.e. v1.2.3)'
required: true
type: string
permissions:
contents: write
jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
fetch-depth: 0
- name: Fetch Version
id: version
run: |
PLUGIN_VERSION=v$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)
echo "::set-output name=PLUGIN_VERSION::$PLUGIN_VERSION"
- name: Check Version
if: ${{ steps.version.outputs.PLUGIN_VERSION != inputs.tag }}
run: echo "Plugin version does not match input tag. Please make sure you have prepared the release first." && exit 1
- name: Set Golang
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.21
- name: Build
run: make build
- name: Create tag
run: git tag ${{ github.event.inputs.tag }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}