forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (92 loc) · 2.96 KB
/
rpk-build.yml
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
# Copyright 2020 Redpanda Data, Inc.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.md
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0
name: rpk
on:
push:
tags:
- 'v2**'
branches:
- '*'
pull_request:
branches:
- main
- dev
jobs:
test:
name: Run tests
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: Run tests
working-directory: src/go/rpk/
run: go test -v ./...
release:
name: Release using goreleaser
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install quill
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b "$HOME/.local/bin" v0.4.1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: Create empty release notes
run: |
echo "" > /tmp/empty_notes
- name: Invoke goreleaser
uses: goreleaser/goreleaser-action@v4
env:
QUILL_SIGN_P12: ${{ secrets.QUILL_SIGN_P12_BASE64 }}
QUILL_SIGN_PASSWORD: ${{ secrets.QUILL_SIGN_PASSWORD }}
QUILL_NOTARY_KEY_ID: ${{ secrets.QUILL_NOTARY_KEY_ID }}
QUILL_NOTARY_KEY: ${{ secrets.QUILL_NOTARY_KEY_BASE64 }}
QUILL_NOTARY_ISSUER: ${{ secrets.QUILL_NOTARY_ISSUER }}
GITHUB_TOKEN: ${{ secrets.VBOT_GITHUB_API_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
workdir: src/go/rpk/
args: release --clean --release-notes /tmp/empty_notes
- name: Archive quill output
if: failure()
uses: actions/upload-artifact@v3
with:
name: quill-logs
path: src/go/rpk/dist/quill-*.log
notify-release-failure:
name: Notify of release failures
runs-on: ubuntu-latest
if: failure()
needs: [release]
steps:
- name: Notify release failure
uses: slackapi/slack-github-action@v1.21.0
with:
channel-id: ${{ secrets.INTERNAL_RELEASES_SLACK_CHANNEL }}
slack-message: "ERROR: release of `rpk` binaries for `${{ github.ref_name }}` failed in ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.VBOTBUILDOVICH_SLACK_BOT_TOKEN }}