-
Notifications
You must be signed in to change notification settings - Fork 71
157 lines (132 loc) · 5.19 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
154
155
156
157
name: Release
concurrency: build
on:
push:
tags:
- "*"
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- name: Prepare - Checkout
uses: actions/[email protected]
- name: Prepare - Inject short Variables
uses: rlespinasse/[email protected]
- name: Prepare - Set up QEMU
uses: docker/[email protected]
- name: Prepare - Set up Docker Buildx
uses: docker/[email protected]
- name: Build - BUILD
uses: docker/[email protected]
with:
load: true
build-args: "NOTIFO__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},NOTIFO__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}"
cache-from: type=gha
cache-to: type=gha,mode=max
tags: notifo-local
- name: Test - Inject Google Credentials
run: mkdir secrets && echo "$GOOGLE__KEYFILE" >| secrets/keyfile.json
working-directory: tools/TestSuite
env:
GOOGLE__KEYFILE: ${{ secrets.GOOGLE__KEYFILE }}
- name: Test - Start Compose
run: docker compose up -d
working-directory: tools/TestSuite
- name: Test - RUN
uses: kohlerdominik/[email protected]
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
MAILCATCHER__HOST__SMTP=mailcatcher
MESSAGEBIRD__ACCESSKEY=${{ secrets.MESSAGEBIRD__ACCESSKEY }}
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8080
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test1
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
- name: Test - RUN on GooglePubSub
uses: kohlerdominik/[email protected]
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
MAILCATCHER__HOST__SMTP=mailcatcher
MESSAGEBIRD__ACCESSKEY=${{ secrets.MESSAGEBIRD__ACCESSKEY }}
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test2
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
- name: Test - Dump docker logs on failure
if: failure()
uses: jwalton/[email protected]
with:
images: 'notifo-local,squidex/resizer'
tail: '100'
- name: Test - Cleanup
if: always()
run: docker compose down
working-directory: tools/TestSuite
- name: Publish - Get Major Version
id: version
uses: rishabhgupta/split-by@v1
with:
string: "${{ env.GITHUB_REF_SLUG }}"
split-by: "."
- name: Publish - Check Tag
id: normal-version
run: |
if [[ ${{ env.GITHUB_REF_SLUG }} =~ ^[0-9]+\.[0-9]+$ ]]; then
echo "STABLE_VERSION=true" >> $GITHUB_ENV
fi
- name: Publish - Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish - Rename Tags
run: |
docker tag notifo-local squidex/notifo:latest
docker tag notifo-local squidex/notifo:${{ env.GITHUB_REF_SLUG }}
docker tag notifo-local squidex/notifo:${{ steps.version.outputs._0 }}
- name: Publish - Push Tags
if: env.STABLE_VERSION == 'true'
run: |
docker tag notifo-local squidex/notifo:latest
docker tag notifo-local squidex/notifo:${{ env.GITHUB_REF_SLUG }}
docker tag notifo-local squidex/notifo:${{ steps.version.outputs._0 }}
- name: Publish - Push Tags
if: env.STABLE_VERSION != 'true'
run: |
docker tag notifo-local squidex/notifo:${{ env.GITHUB_REF_SLUG }}
- name: Release - Make directories
run: sudo mkdir /build /release
- name: Release - Create container
run: docker create --name notifo-container notifo-local
- name: Release - Get binaries
run: sudo docker cp notifo-container:/app/. /build
- name: Release - Zip Binaries
run: sudo zip -r /release/binaries.zip .
working-directory: /build
- name: Release - Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.GITHUB_REF_SLUG }}
path: ./CHANGELOG.md
- name: Release - Publish Binaries
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "/release/binaries.zip"
body: ${{ steps.changelog_reader.outputs.changes }}
name: ${{ env.GITHUB_REF_SLUG }}
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release - Cleanup Binaries
if: always()
run: docker rm notifo-container