forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.32 KB
/
release-goreleaser.yml
File metadata and controls
76 lines (65 loc) · 2.32 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Unified release workflow: master push releases + nightly scheduled releases.
# Replaces the old releaser-master.yml and releaser-nightly.yml.
name: release / goreleaser
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * 2-6" # nightly Tue-Sat
workflow_dispatch:
inputs:
snapshot:
description: "Build as snapshot (no publish)"
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
# Dummy tag needed for goreleaser on non-tag pushes
- name: Create a dummy tag to avoid goreleaser failure
if: github.event_name == 'push'
run: git tag v0.0.0 master
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: sigstore/cosign-installer@v3.9.2
- uses: anchore/sbom-action/download-syft@v0.20.5
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Determine release args
id: args
run: |
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ inputs.snapshot }}" = "true" ]; then
echo "goreleaser-args=release --clean --nightly --snapshot --config ./.github/goreleaser.yaml" >> $GITHUB_OUTPUT
echo "tag-version=nightly" >> $GITHUB_OUTPUT
else
echo "goreleaser-args=release --clean --nightly --config ./.github/goreleaser.yaml" >> $GITHUB_OUTPUT
echo "tag-version=master" >> $GITHUB_OUTPUT
fi
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: ~> v2
args: ${{ steps.args.outputs.goreleaser-args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
TAG_VERSION: ${{ steps.args.outputs.tag-version }}