This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (80 loc) · 2.49 KB
/
release.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
name: "New Release"
on:
milestone:
types: [closed]
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
GO: 1.17
jobs:
bump-version:
if: github.event_name == 'milestone'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO }}
- name: Configure Git
run: |
git config user.name "sv-tools-bot"
git config user.email "[email protected]"
git fetch --all
- name: Create Tag
run: |
docker run --rm -v $PWD:/mount -w /mount svtools/bumptag:latest ${{ github.event.milestone.title }}
- name: Push Tag
run: git push origin --tags
- name: Create Milestone
uses: WyriHaximus/[email protected]
with:
title: Next
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
release-cli:
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO }}
- name: Prepare gpg
run: |
gpgconf --kill gpg-agent
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE }}" --output .github/sv-tools-bot.asc .github/sv-tools-bot.asc.gpg
gpg --batch --yes --import .github/sv-tools-bot.asc
rm .github/sv-tools-bot.asc
- name: Allow arm Docker builds # https://github.com/linuxkit/linuxkit/tree/master/pkg/binfmt
run: sudo docker run --privileged linuxkit/binfmt:v0.8
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: sv-tools-bot
password: ${{ secrets.BOT_TOKEN }}
- name: Docker Login
uses: docker/login-action@v1
with:
username: svtools
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --config .github/goreleaser-cli.yml
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Clear
if: always()
run: rm -f ${HOME}/.docker/config.json