Repository navigation
59 lines (59 loc) · 1.55 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (59 loc) · 1.55 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
name: Release
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: release
cancel-in-progress: true
run-name: Release by @${{ github.actor }} ${{ github.sha }}
permissions:
contents: write
packages: write
id-token: write
pull-requests: read
jobs:
get-version:
name: Version
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Get Release Version
id: get-version
uses: nullify-platform/github-actions/actions/release-version@main
- run: |
{
echo "**Version:** ${{ steps.get-version.outputs.version }}"
echo "**Short SHA:** $(git rev-parse --short HEAD)"
} >> "$GITHUB_STEP_SUMMARY"
goreleaser:
if: ${{ needs.get-version.outputs.version != 'undefined' }}
name: GoReleaser
needs: [get-version]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Create and push tag
env:
VERSION: ${{ needs.get-version.outputs.version }}
run: |
git tag "v${VERSION}"
git push origin "v${VERSION}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ github.token }}