-
Notifications
You must be signed in to change notification settings - Fork 10
108 lines (91 loc) · 3.12 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: release
on:
push:
tags:
- "v*"
workflow_dispatch: {}
jobs:
artifacts:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
steps:
# --------------------------------------------------------------------------
# Repository Checkout
# --------------------------------------------------------------------------
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup golang
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# --------------------------------------------------------------------------
# Build & Upload Artifacts
# --------------------------------------------------------------------------
- name: build for ${{ matrix.os }} ${{ matrix.arch }}
run: make build GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
- name: upload ${{ matrix.os }} ${{ matrix.arch }} artifact
uses: actions/upload-artifact@v3
with:
name: bin
path: build/ktf.${{ matrix.os }}.${{ matrix.arch }}
if-no-files-found: error
# --------------------------------------------------------------------------
# Generate Checksums
# --------------------------------------------------------------------------
- name: generate checksum for ${{ matrix.os }} ${{ matrix.arch }} artifact
run: sha256sum ktf.${{ matrix.os }}.${{ matrix.arch }} >> CHECKSUMS.${{ matrix.os }}.${{ matrix.arch }}
working-directory: ./build/
- name: upload checksum for ${{ matrix.os }} ${{ matrix.arch }}
uses: actions/upload-artifact@v3
with:
name: CHECKSUMS
path: build/CHECKSUMS.${{ matrix.os }}.${{ matrix.arch }}
if-no-files-found: error
# --------------------------------------------------------------------------
# Release Job
# --------------------------------------------------------------------------
release:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }}
runs-on: ubuntu-latest
needs:
- artifacts
steps:
# --------------------------------------------------------------------------
# Github Release
# --------------------------------------------------------------------------
- name: download checksums artifact
uses: actions/download-artifact@v3
with:
name: CHECKSUMS
- name: concatenate all checksums
run: cat CHECKSUMS.* > CHECKSUMS
- name: download binary artifacts
uses: actions/download-artifact@v3
with:
name: bin
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
files: |
CHECKSUMS
ktf.*
body: |
See the [CHANGELOG.md](https://raw.githubusercontent.com/Kong/kubernetes-testing-framework/main/CHANGELOG.md)
env:
GITHUB_TOKEN: ${{ github.token }}