-
-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (45 loc) · 1.32 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
name: release
on:
push:
tags:
- '*'
env:
GO: 1.18.x
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO }}
- name: Docker Login
if: success() && startsWith(github.ref, 'refs/tags/')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.CLIENT_ID }}
repositorys: homebrew-kubectl-bindrole
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
- name: Update new version in krew-index
uses: rajatjindal/[email protected]
- name: Clear
if: always() && startsWith(github.ref, 'refs/tags/')
run: |
rm -f ${HOME}/.docker/config.json