-
Notifications
You must be signed in to change notification settings - Fork 61
153 lines (131 loc) · 4.42 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Release Workflow
on:
push:
tags:
- v*
permissions:
contents: read
jobs:
build:
name: Build Shoutrrr
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: arnested/go-version-action@v1
id: go-version
- name: Set up Go ${{ steps.go-version.outputs.latest }}
uses: actions/setup-go@v5
id: go
with:
go-version: ${{ steps.go-version.outputs.latest }}
check-latest: true
- name: Build
run: CGO_ENABLED=0 go build -v .
- name: Test
run: CGO_ENABLED=0 go test -v -coverprofile=coverage.out -covermode=atomic ./...
- name: Publish coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: Show GoReleaser version
run: goreleaser -v
- name: Login to docker hub
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_USER }}'
password: '${{ secrets.DOCKER_PASSWORD }}'
- name: Execute goreleaser
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} CGO_ENABLED=0 goreleaser --debug --rm-dist
- name: Enable experimental docker features
run: |
mkdir -p ~/.docker/ && \
echo '{"experimental": "enabled"}' > ~/.docker/config.json
- name: Create manifest for version
run: |
docker manifest create \
containrrr/shoutrrr:${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:amd64-${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:i386-${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:armhf-${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:arm64v8-${GITHUB_REF/refs\/tags\/v/}
- name: Annotate i386 version
run: |
docker manifest annotate \
containrrr/shoutrrr:${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:i386-${GITHUB_REF/refs\/tags\/v/} \
--os linux \
--arch 386
- name: Annotate ARM version
run: |
docker manifest annotate \
containrrr/shoutrrr:${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:armhf-${GITHUB_REF/refs\/tags\/v/} \
--os linux \
--arch arm
- name: Annotate ARM64 version
run: |
docker manifest annotate \
containrrr/shoutrrr:${GITHUB_REF/refs\/tags\/v/} \
containrrr/shoutrrr:arm64v8-${GITHUB_REF/refs\/tags\/v/} \
--os linux \
--arch arm64 \
--variant v8
- name: Create manifest for latest
run: |
docker manifest create \
containrrr/shoutrrr:latest \
containrrr/shoutrrr:amd64-latest \
containrrr/shoutrrr:i386-latest \
containrrr/shoutrrr:armhf-latest \
containrrr/shoutrrr:arm64v8-latest
- name: Annotate i386 latest
run: |
docker manifest annotate \
containrrr/shoutrrr:latest \
containrrr/shoutrrr:i386-latest \
--os linux \
--arch 386
- name: Annotate ARM latest
run: |
docker manifest annotate \
containrrr/shoutrrr:latest \
containrrr/shoutrrr:armhf-latest \
--os linux \
--arch arm
- name: Annotate ARM64 latest
run: |
docker manifest annotate \
containrrr/shoutrrr:latest \
containrrr/shoutrrr:arm64v8-latest \
--os linux \
--arch arm64 \
--variant v8
- name: Push manifests to Dockerhub
run: |
docker manifest push containrrr/shoutrrr:${GITHUB_REF/refs\/tags\/v/} && \
docker manifest push containrrr/shoutrrr:latest
snap:
name: Build Shoutrrr snap
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: snapcore/action-build@v1
name: Build snap
id: build
- uses: snapcore/action-publish@v1
name: Release snap
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge