forked from slingdata-io/sling-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.47 KB
/
release.yml
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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version number for this release (e.g., v1.0.0 or v1.0.0-rc1)'
required: true
default: 'v1.0.0'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.22' # Adjust this to your Go version
- name: Set release version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
git config user.name github-action
git config user.email [email protected]
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
else
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*