-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (108 loc) · 3.57 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
name: Build
on:
push:
pull_request:
release:
types:
- created
concurrency:
group: "build"
cancel-in-progress: true
jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4
- 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:
needs: [cleanup]
uses: AmplitudeAudio/sdk/.github/workflows/cmake.yml@develop
with:
project-path: .
project-slug: plugin_flac
pull-sdk: true
sdk-version: nightly
need-flatc: false
name: Flac Codec
release:
needs: [build]
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
archiver: "7z a"
target_triplet: x64-windows
- name: "Windows Latest MinGW"
os: windows-latest
archiver: "7z a"
target_triplet: x64-mingw-static
- name: "Ubuntu Latest GCC"
os: ubuntu-latest
archiver: "7z a"
target_triplet: x64-linux
- name: "macOS x64 Latest Clang"
os: macos-13
archiver: "7za a"
target_triplet: x64-osx
- name: "macOS arm64 Latest Clang"
os: macos-14
archiver: "7za a"
target_triplet: arm64-osx
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Restore SDK Cache
uses: actions/cache/restore@v4
with:
enableCrossOsArchive: true
path: sdk
key: ${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}-${{ hashFiles('**/sdk') }}
restore-keys: |
${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}-
- name: Pack
shell: bash
run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z LICENSE README.md sdk
- name: Upload
uses: actions/upload-artifact@v4
with:
path: |
LICENSE
README.md
sdk/
name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}
- 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 }}_plugin_flac_${{ matrix.config.target_triplet }}.7z
asset_name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z
asset_content_type: application/x-7z-compressed