-
Notifications
You must be signed in to change notification settings - Fork 11
127 lines (115 loc) · 3.58 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
build_from:
description: |
Branch or tag to build release artifacts from.
required: false
release_as:
description: |
Publish release under this tag, or update release assets if such release exists.
If empty, release publishing will be skipped.
required: false
default: ""
jobs:
mac:
strategy:
fail-fast: false
matrix:
otp:
- 25.3.2-2
- 26.1.2-1
os:
- macos-13
- macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.inputs.build_from }} # when input is not given, the event tag is used
- uses: ./.github/actions/macos-erlang
with:
otp: ${{ matrix.otp }}
os: ${{ matrix.os }}
- name: build release
run: |
. $HOME/.kerl/${{ matrix.otp }}/activate
env BUILD_RELEASE=1 CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} ./build.sh
- uses: actions/upload-artifact@v3
with:
name: packages
path: |
_packages/*.tar.gz
_packages/*.tar.gz.sha256
linux:
strategy:
fail-fast: false
matrix:
builder:
- 5.3-8:1.15.7-25.3.2-2
- 5.3-8:1.15.7-26.2.5-2
arch:
- amd64
- arm64
os:
- ubuntu24.04
- ubuntu22.04
- ubuntu20.04
- debian12
- debian11
- debian10
- amzn2
- amzn2023
- el8
- el9
- alpine3.15.1
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/emqx/emqx-builder/${{ matrix.builder }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.build_from }} # when input is not given, the event tag is used
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.arch }}
- name: build release
if: matrix.os == 'amzn2'
run: |
docker build --platform=linux/${{ matrix.arch }} --build-arg FROM=$IMAGE -t emqx-builder:amzn2 -f .ci/Dockerfile.amzn2 .
docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} -e BUILD_RELEASE=1 -e CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} emqx-builder:amzn2 bash -euc './build.sh'
- name: build release
if: matrix.os != 'amzn2'
run: |
docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} -e BUILD_RELEASE=1 -e CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} $IMAGE bash -euc './build.sh'
- uses: actions/upload-artifact@v3
with:
name: packages
path: |
_packages/*.tar.gz
_packages/*.tar.gz.sha256
release:
runs-on: ubuntu-latest
needs:
- mac
- linux
if: startsWith(github.ref, 'refs/tags/') || inputs.release_as
steps:
- uses: actions/download-artifact@v3
with:
name: packages
path: packages
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Erlang jq NIF ${{ github.event.inputs.release_as || github.ref_name }} Released
tag_name: ${{ github.event.inputs.release_as || github.ref_name }}
files: "packages/*"