-
Notifications
You must be signed in to change notification settings - Fork 24
72 lines (61 loc) · 1.84 KB
/
release.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
70
71
72
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
cli:
name: Release the CLI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ko-resolve:
needs: cli
name: Release ko artifact and push to Github Container Registry
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21.x
uses: actions/setup-go@v3
with:
go-version: 1.21.x
# will install latest ko version and default login/configure
# KO_DOCKER_REPO to ghcr.io
- name: Setup ko for ghcr.io
uses: ko-build/[email protected]
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Get Release URL
id: get_release_url
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build and Publish images, Produce release artifact.
run: |
ko resolve --platform=all --tags $(basename "${{ github.ref }}" ) -BRf config/ > release.yaml
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_url.outputs.upload_url }}
asset_path: ./release.yaml
asset_name: release.yaml
asset_content_type: text/plain