-
Notifications
You must be signed in to change notification settings - Fork 396
68 lines (59 loc) · 1.79 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
name: tagged-release
on:
push:
tags:
- 'v[1-9].[0-9]+.[0-9]+'
jobs:
github-release:
name: 'GitHub Release'
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# https://github.com/marketplace/actions/goreleaser-action#usage
# note the fetch-depth: 0 input in Checkout step. It is required for
# the changelog to work correctly
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
snapcraft-stable:
name: 'Snapcraft: Stable Release'
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# fetch-depth: 0 fetches all history for all branches and tags
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build snap
id: build
run: |
make _build_snap && \
find doctl_v*.snap -exec echo "snap={}" >> "$GITHUB_OUTPUT" \;
- uses: snapcore/action-publish@master
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_TOKEN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: stable