-
Notifications
You must be signed in to change notification settings - Fork 19
52 lines (49 loc) · 1.52 KB
/
Copy pathrelease.yml
File metadata and controls
52 lines (49 loc) · 1.52 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
name: GoReleaser
on:
workflow_dispatch:
inputs:
bump_type:
description: 'Bump tag type: major, minor, patch. default: minor'
required: true
default: 'minor'
permissions: write-all
jobs:
goreleaser:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: stable
- name: Bump tag version
id: bumpTag
uses: anothrNick/github-tag-action@1.75.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DRY_RUN: true
DEFAULT_BUMP: "${{ github.event.inputs.bump_type }}"
- name: Bump tag locally
run: git tag ${{ steps.bumpTag.outputs.new_tag }}
- name: Set environment variables
run: |
echo "GOLANG_VERSION=$(go version)" >> $GITHUB_ENV
echo "BUILT_BY=$(whoami)@$(hostname)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOLANG_VERSION: ${{ env.GOLANG_VERSION }}
BUILT_BY: ${{ env.BUILT_BY }}