-
Notifications
You must be signed in to change notification settings - Fork 22
104 lines (92 loc) · 3.79 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
# This workflow will only trigger when a release is created,
# as this is where the artifacts will be visible.
# To create a release, use the script `infrastructure/github/release.d`.
#
# There is no `repository == bosagora/agora` protection like in other CI scripts,
# as the artifacts are local to the repository, so there is no access issue,
# and releases are not part of the synchronization of a fork with an upstream,
# while commits and tags are, so creating a release in a fork is a deliberate action.
name: Generate native build for release
on:
release:
types:
- published
jobs:
build:
name: 'Build artifacts for ${{ github.event.release.tag_name }}'
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, dc: ldc-1.28.1, triple: 'x86_64-linux-gnu-ubuntu-20.04' }
- { os: macOS-11, dc: ldc-1.28.1, triple: 'x86_64-apple-darwin-macOS11' }
runs-on: ${{ matrix.os }}
steps:
- name: '[Linux] Install dependencies & setup environment'
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libsodium-dev libsqlite3-dev clang
- name: '[OSX] Install dependencies & setup environment'
if: runner.os == 'macOS'
run: |
brew install coreutils libsodium pkg-config
echo "LIBRARY_PATH=${LD_LIBRARY_PATH-}:/usr/local/lib/" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig/" >> $GITHUB_ENV
- name: Install D build tools
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- uses: actions/checkout@v2
with:
submodules: true
- name: 'Build Agora and other configs'
env:
AGORA_VERSION: ${{ github.event.release.tag_name }}
run: |
dub build --skip-registry=all --compiler=${DC}
mv -v build/agora build/agora-${{ github.event.release.tag_name }}+${{ matrix.triple }}
dub build --skip-registry=all --compiler=${DC} -c client
mv -v build/agora-client build/agora-client-${{ github.event.release.tag_name }}+${{ matrix.triple }}
dub build --skip-registry=all --compiler=${DC} -c config-dumper
mv -v build/agora-config-dumper build/agora-config-dumper-${{ github.event.release.tag_name }}+${{ matrix.triple }}
dub build --skip-registry=all --compiler=${DC} -c traced-server
mv -v build/agora-traced build/agora-traced-${{ github.event.release.tag_name }}+${{ matrix.triple }}
- name: 'Upload temporary binaries'
uses: actions/upload-artifact@v2
with:
name: agora
path: |
build/*${{ matrix.triple }}
if-no-files-found: error
retention-days: 1
release:
name: "Update release artifacts"
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifacts to release
uses: actions/download-artifact@v2
with:
name: agora
path: ~/artifacts/
- name: List all artifacts included in the release
id: list-artifacts
shell: bash
run: |
set -euox pipefail
ls -aul ~ ~/artifacts
echo "::set-output name=artifacts_directory::$HOME/artifacts"
- name: Update release artifacts
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag: ${{ github.event.release.tag_name }}
artifacts: ${{ steps.list-artifacts.outputs.artifacts_directory }}/*
# Keep the existing state of the release
allowUpdates: true
artifactErrorsFailBuild: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitPrereleaseDuringUpdate: true