-
Notifications
You must be signed in to change notification settings - Fork 455
161 lines (136 loc) · 5.28 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
158
159
160
161
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: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}"
cache-from: type=gha
cache-to: type=gha,mode=max
tags: squidex-local
- name: Test - Start Compose
run: docker-compose up -d
working-directory: tools/TestSuite
- name: Test - RUN
uses: kohlerdominik/[email protected]
with:
image: squidex/build:7
environment: |
CONFIG__BACKUPURL=http://localhost:5000
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 path
uses: kohlerdominik/[email protected]
with:
image: squidex/build:7
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081/squidex
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 - RUN with dedicated collections
uses: kohlerdominik/[email protected]
with:
image: squidex/build:7
environment: |
CONFIG__BACKUPURL=http://localhost:5000
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8082
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test3
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: 'squidex-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/[email protected]
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]+(\.[0-9]+){0,2}$ ]]; 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 squidex-local squidex/squidex:latest
docker tag squidex-local squidex/squidex:${{ env.GITHUB_REF_SLUG }}
docker tag squidex-local squidex/squidex:${{ steps.version.outputs._0 }}
- name: Publish - Push Tags
run: |
docker push squidex/squidex:${{ env.GITHUB_REF_SLUG }}
docker push squidex/squidex:${{ steps.version.outputs._0 }}
- name: Publish - Push Tags Latest
if: env.STABLE_VERSION == 'true'
run: |
docker push squidex/squidex:latest
- name: Release - Make directories
run: sudo mkdir /build /release
- name: Release - Create container
run: docker create --name squidex-container squidex-local
- name: Release - Get binaries
run: sudo docker cp squidex-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/[email protected]
with:
version: ${{ env.GITHUB_REF_SLUG }}
path: ./CHANGELOG.md
- name: Release - Publish Binaries
uses: ncipollo/[email protected]
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 squidex-container