-
Notifications
You must be signed in to change notification settings - Fork 11
115 lines (97 loc) · 3.57 KB
/
release.yaml
File metadata and controls
115 lines (97 loc) · 3.57 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
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
109
110
111
112
113
114
115
name: release
on:
push:
tags:
- "v*"
workflow_dispatch: {}
permissions:
contents: read
jobs:
artifacts:
timeout-minutes: 10
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: setup golang
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: bin-${{ matrix.os }}-${{ matrix.arch }}
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: CHECKSUMS-${{ matrix.os }}-${{ matrix.arch }}
path: build/CHECKSUMS.${{ matrix.os }}.${{ matrix.arch }}
if-no-files-found: error
# --------------------------------------------------------------------------
# Release Job
# --------------------------------------------------------------------------
release:
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- artifacts
permissions:
contents: write
steps:
# --------------------------------------------------------------------------
# Github Release
# --------------------------------------------------------------------------
- name: download checksums artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: CHECKSUMS*
merge-multiple: true
- name: concatenate all checksums
run: cat CHECKSUMS.* > CHECKSUMS
- name: download binary artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: bin*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
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 }}