4
4
push :
5
5
tags :
6
6
- " *"
7
+ workflow_dispatch :
8
+ inputs :
9
+ branch_or_tag :
10
+ required : false
11
+ is_release :
12
+ required : false
13
+ default : false
14
+
7
15
jobs :
8
16
mac :
9
17
strategy :
@@ -15,12 +23,14 @@ jobs:
15
23
os :
16
24
- macos-11
17
25
- macos-12
26
+ - macos-12-arm64
18
27
runs-on : ${{ matrix.os }}
19
28
steps :
20
29
- uses : actions/checkout@v3
21
30
with :
22
31
submodules : recursive
23
32
fetch-depth : 0
33
+ ref : ${{ github.event.inputs.branch_or_tag }} # when input is not given, the event tag is used
24
34
25
35
- name : Configure Homebrew cache
26
36
uses : actions/cache@v3
@@ -36,18 +46,22 @@ jobs:
36
46
# brew update
37
47
brew install curl zip unzip gnu-sed automake bison
38
48
brew install erlang@${{ matrix.otp }}
39
- echo "/usr/local/bin" >> $GITHUB_PATH
49
+ echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
50
+ echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
40
51
git config --global credential.helper store
41
52
53
+ - name : build
54
+ if : ! startsWith(github.ref, 'refs/tags/') || inputs.is_release == false
55
+ run : |
56
+ ./build.sh
57
+
42
58
- name : build release
43
- if : startsWith(github.ref, 'refs/tags/')
59
+ if : startsWith(github.ref, 'refs/tags/') || inputs.is_release == true
44
60
run : |
45
- export PATH="/usr/local/opt/bison/bin:$PATH"
46
- export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:$PATH"
47
61
env BUILD_RELEASE=1 ./build.sh
48
62
49
63
- uses : actions/upload-artifact@v3
50
- if : startsWith(github.ref, 'refs/tags/')
64
+ if : startsWith(github.ref, 'refs/tags/') || inputs.is_release == true
51
65
with :
52
66
name : packages
53
67
path : |
@@ -59,46 +73,56 @@ jobs:
59
73
fail-fast : false
60
74
matrix :
61
75
builder :
62
- - 5.0-26
76
+ - 5.0-32
63
77
otp :
64
- - 24.3.4.2-1
78
+ - 24.3.4.2-2
65
79
- 25.1.2-2
66
80
elixir :
67
81
- 1.13.4
68
82
arch :
69
83
- amd64
70
84
- arm64
71
85
os :
86
+ - ubuntu22.04
72
87
- ubuntu20.04
73
88
- ubuntu18.04
74
89
- ubuntu16.04
75
90
- debian11
76
91
- debian10
77
92
- debian9
93
+ - amzn2
78
94
- el7
79
95
- el8
96
+ - el9
80
97
- alpine3.15.1
81
98
runs-on : ubuntu-latest
82
99
83
100
steps :
84
101
- uses : actions/checkout@v3
85
102
with :
86
103
fetch-depth : 0
104
+ ref : ${{ github.event.inputs.branch_or_tag }} # when input is not given, the event tag is used
87
105
88
106
- uses : docker/setup-buildx-action@v2
89
107
90
108
- uses : docker/setup-qemu-action@v2
91
109
with :
92
110
platforms : ${{ matrix.arch }}
93
111
112
+ - name : build
113
+ if : ! startsWith(github.ref, 'refs/tags/') || inputs.is_release == false
114
+ run : |
115
+ IMAGE=ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}
116
+ docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} $IMAGE bash -euc './build.sh'
117
+
94
118
- name : build release
95
- if : startsWith(github.ref, 'refs/tags/')
119
+ if : startsWith(github.ref, 'refs/tags/') || inputs.is_release == true
96
120
run : |
97
121
IMAGE=ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}
98
122
docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} -e BUILD_RELEASE=1 $IMAGE bash -euc './build.sh'
99
123
100
124
- uses : actions/upload-artifact@v3
101
- if : startsWith(github.ref, 'refs/tags/')
125
+ if : startsWith(github.ref, 'refs/tags/') || inputs.is_release == true
102
126
with :
103
127
name : packages
104
128
path : |
@@ -110,7 +134,7 @@ jobs:
110
134
needs :
111
135
- mac
112
136
- linux
113
- if : startsWith(github.ref, 'refs/tags/')
137
+ if : startsWith(github.ref, 'refs/tags/') || inputs.is_release == true
114
138
steps :
115
139
- uses : actions/download-artifact@v3
116
140
with :
0 commit comments