-
Notifications
You must be signed in to change notification settings - Fork 4
127 lines (109 loc) · 3.73 KB
/
build.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
name: Build and release Amplitude Audio SDK
on:
push:
pull_request:
release:
tags:
- "v*"
jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=${{ github.ref }}
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-sdk:
needs: [ cleanup ]
uses: ./.github/workflows/cmake.yml
with:
project-path: .
name: Amplitude Audio SDK
build-plugins:
needs: [ build-sdk ]
uses: ./.github/workflows/cmake.yml
with:
project-path: ./plugins/${{ matrix.project.path }}
name: ${{ matrix.project.name }}
strategy:
matrix:
project:
- name: FLAC Codec
path: codec-flac
release:
needs: [ build-plugins ]
runs-on: ${{ matrix.config.os }}
name: "[${{ matrix.build_type }}] ${{ matrix.config.name }}"
strategy:
fail-fast: false
matrix:
build_type: [ "release", "debug" ]
config:
- name: "Windows Latest MSVC"
os: windows-latest
artifact: "amplitude_audio_sdk_windows_msvc_x64.7z"
archiver: "7z a"
- name: "Windows Latest MinGW"
os: windows-latest
artifact: "amplitude_audio_sdk_windows_mingw_x64.7z"
archiver: "7z a"
- name: "Ubuntu_Latest_GCC"
os: ubuntu-latest
artifact: "amplitude_audio_sdk_linux_gcc_x64.7z"
archiver: "7z a"
- name: "Ubuntu_GCC_9"
os: ubuntu-latest
artifact: "amplitude_audio_sdk_linux_gcc9_x64.7z"
archiver: "7z a"
- name: "macOS Latest Clang"
os: macos-latest
artifact: "amplitude_audio_sdk_macos_clang_x64.7z"
archiver: "7za a"
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup SDK Cache
uses: actions/cache@v3
with:
enableCrossOsArchive: true
path: sdk
key: ${{ matrix.build_type }}-${{ matrix.config.artifact }}-${{ hashFiles('sdk/**/*.*') }}
restore-keys: |
${{ matrix.build_type }}-${{ matrix.config.artifact }}-
- name: Pack
shell: bash
run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_${{ matrix.config.artifact }} LICENSE README.md sdk
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }}
name: ${{ matrix.build_type }}_${{ matrix.config.artifact }}
- name: Upload release asset
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }}
asset_name: ${{ matrix.build_type }}_${{ matrix.config.artifact }}.zip
asset_content_type: application/zip