-
Notifications
You must be signed in to change notification settings - Fork 8
186 lines (166 loc) · 5.09 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
ref:
type: string
required: true
dryrun:
type: boolean
required: true
default: false
jobs:
# Build documentation once, since it requires a lot of 3rd party
# tooling, then reuse it as an artifact:
docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/emqx/emqx-builder/5.3-6:1.15.7-26.2.3-1-ubuntu24.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- shell: bash
name: Install additional packages
run: |
apt-get update
apt-get install -y openjdk-11-jdk asciidoctor xsltproc docbook-xsl python3-pygments
- name: Build
shell: bash
run: |
export BUILD_WITHOUT_QUIC=1
git config --global --add safe.directory $(pwd)
make release
tar czf docs.tar.gz _build/lee_doc/html _build/lee_doc/man _build/lee_doc/src/
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: docs
path: docs.tar.gz
# Do normal builds:
linux:
runs-on: ubuntu-latest
needs: docs
strategy:
fail-fast: false
matrix:
otp:
- "26.2.3-1"
os:
- ubuntu24.04
- ubuntu22.04
- ubuntu20.04
- debian12
- debian11
- debian10
- el9
- el8
- el7
- amzn2
- amzn2023
env:
EMQX_BUILDER: ghcr.io/emqx/emqx-builder/5.3-6:1.15.7-${{ matrix.otp }}-${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs
path: .
- name: Build
shell: bash
run: |
tar xf docs.tar.gz
docker run -t --rm -v $(pwd):/emqttb -w /emqttb -e CAN_BUILD_DOCS=false -e REBAR=/usr/local/bin/rebar3 $EMQX_BUILDER bash -c 'git config --global --add safe.directory /emqttb && make release'
- name: Test
shell: bash
run: |
mkdir test-package
cp *.tar.gz test-package/
pushd test-package
tar xfz emqttb*.tar.gz
docker network create emqttb
docker run -d --name emqx --network emqttb emqx/emqx:latest
docker run -t --rm -v $(pwd):/emqttb -w /emqttb --network emqttb $EMQX_BUILDER bash -c 'bin/emqttb --loiter 5s @pub -t test @g --host emqx'
popd
- if: failure()
run: cat rebar3.crashdump
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success()
with:
name: emqttb-${{ matrix.os }}-${{ matrix.otp }}
path: ./emqttb*.tar.gz
mac:
strategy:
fail-fast: false
matrix:
macos:
- macos-13
- macos-14
otp:
- "26"
runs-on: ${{ matrix.macos }}
needs: docs
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- name: prepare
run: |
brew install coreutils erlang@${{ matrix.otp }}
brew link --force erlang@${{ matrix.otp }}
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs
path: .
- name: build
shell: bash
run: |
tar xf docs.tar.gz
export CAN_BUILD_DOCS=false
export BUILD_WITHOUT_QUIC=1
make release
- name: Test
shell: bash
run: |
brew install emqx
emqx start
mkdir test-package
cp *.tar.gz test-package/
pushd test-package
tar xfz emqttb*.tar.gz
bin/emqttb --loiter 5s @pub -t test @g --host localhost
popd
- if: failure()
run: cat rebar3.crashdump
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success()
with:
name: emqttb-${{ matrix.macos }}-${{ matrix.otp }}
path: ./emqttb-*.tar.gz
release:
runs-on: ubuntu-latest
needs:
- linux
- mac
if: startsWith(github.ref, 'refs/tags/') && !inputs.dryrun
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: "emqttb-*"
path: packages
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
name: EMQTT bench daemon ${{ github.ref_name }} Released
body: EMQTT bench daemon ${{ github.ref_name }} Released
files: packages/*
draft: false
prerelease: false