Repository navigation
79 lines (63 loc) 路 1.85 KB
/
Copy pathrelease.yaml
File metadata and controls
79 lines (63 loc) 路 1.85 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
77
78
79
# SPDX-FileCopyrightText: (c) 2024 The Drassi Authors
#
# SPDX-License-Identifier: Apache-2.0
name: Release
on:
release:
types: [created]
jobs:
publish:
if: startsWith(github.ref, 'refs/tags/v') == true
name: Publish
runs-on: ubuntu-22.04
permissions:
id-token: write # for cosign
packages: write
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.work
cache-dependency-path: go.work.sum
- name: Setup Cosgin
uses: sigstore/cosign-installer@v4.1.2
with:
cosign-release: v3.1.1
- name: Setup Syft
uses: anchore/sbom-action/download-syft@v0.24.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: goreleaser/goreleaser-action@v7
with:
args: release --clean --timeout 60m
version: "~> v2"
env:
GITHUB_TOKEN: $${{ github.token }}
- name: Save release assets
uses: actions/upload-artifact@v7
with:
name: release-assets
path: release/
- name: Attach assets to release
uses: FabianKramm/release-asset-action@v1
with:
pattern: "release/*"
github-token: ${{ github.token }}