-
Notifications
You must be signed in to change notification settings - Fork 545
69 lines (63 loc) · 2.27 KB
/
goreleaser.yaml
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
name: release
on:
pull_request:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Get the image tag
run: |
# Source: https://github.community/t/how-to-get-just-the-tag-name/16241/32
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo IMAGE_TAG="snapshot" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Docker Login
uses: docker/login-action@v3
if: startsWith(github.ref, 'refs/tags')
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: 0.177.0
args: release --rm-dist ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
env:
GITHUB_TOKEN: ${{ github.token }}
IMAGE_REPO: quay.io/operator-framework/olm
PKG: github.com/operator-framework/operator-lifecycle-manager
# The below steps depend on a image being present in a image registry
# as well as existence of a release on GitHub which are not
# being created by goreleaser when run against anything other than a tag.
# So we only run the steps below for tags.
- name: Generate quickstart release manifests
if: startsWith(github.ref, 'refs/tags')
run: make release RELEASE_VERSION=${{ env.IMAGE_TAG }} IMAGE_REPO=quay.io/operator-framework/olm
- name: Update release artifacts with rendered Kubernetes release manifests
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags')
with:
name: ${{ env.IMAGE_TAG }}
files: |
deploy/upstream/quickstart/crds.yaml
deploy/upstream/quickstart/olm.yaml
deploy/upstream/quickstart/install.sh
draft: true
token: ${{ github.token }}