-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (46 loc) · 1.31 KB
/
release.yml
File metadata and controls
52 lines (46 loc) · 1.31 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: release
on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- main
merge_group:
jobs:
goreleaser:
name: release
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Docker Login
uses: docker/login-action@v3
if: ${{ github.event_name != 'pull_request' }}
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set the release related variables
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo VERSION="$(echo "${GITHUB_REF#refs/tags/}" | sed 's/^v//')" >> $GITHUB_ENV
echo GORELEASER_ARGS="--clean" >> $GITHUB_ENV
echo ENABLE_RELEASE_PIPELINE=true >> $GITHUB_ENV
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo TAG=snapshot >> $GITHUB_ENV
echo ENABLE_RELEASE_PIPELINE=true >> $GITHUB_ENV
fi
- name: Release
run: make release
env:
GITHUB_TOKEN: ${{ github.token }}