Skip to content

Commit fedd2f5

Browse files
committed
fix(ci): Pull SDK from nightly builds.
1 parent 8fef726 commit fedd2f5

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
- name: Cleanup
2626
run: |
2727
gh extension install actions/gh-actions-cache
28-
28+
2929
REPO=${{ github.repository }}
3030
BRANCH=${{ github.ref }}
31-
31+
3232
echo "Fetching list of cache key"
3333
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
34-
34+
3535
## Setting this to not fail the workflow while deleting cache keys.
3636
set +e
3737
echo "Deleting caches..."
@@ -44,46 +44,49 @@ jobs:
4444
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545

4646
build:
47-
needs: [ cleanup ]
47+
needs: [cleanup]
4848
uses: AmplitudeAudio/sdk/.github/workflows/cmake.yml@develop
4949
with:
5050
project-path: .
5151
project-slug: plugin_flac
52+
pull-sdk: true
53+
sdk-version: nightly
54+
need-flatc: false
5255
name: Flac Codec
5356

5457
release:
55-
needs: [ build ]
58+
needs: [build]
5659
runs-on: ${{ matrix.config.os }}
5760
name: "[${{ matrix.build_type }}] ${{ matrix.config.name }}"
5861
strategy:
5962
fail-fast: false
6063
matrix:
61-
build_type: [ "release", "debug" ]
64+
build_type: ["release", "debug"]
6265
config:
6366
- name: "Windows Latest MSVC"
6467
os: windows-latest
65-
artifact: "plugin_flac_windows_msvc_x64.7z"
6668
archiver: "7z a"
69+
target_triplet: x64-windows
6770

6871
- name: "Windows Latest MinGW"
6972
os: windows-latest
70-
artifact: "plugin_flac_windows_mingw_x64.7z"
7173
archiver: "7z a"
74+
target_triplet: x64-mingw-static
7275

7376
- name: "Ubuntu Latest GCC"
7477
os: ubuntu-latest
75-
artifact: "plugin_flac_linux_gcc_x64.7z"
7678
archiver: "7z a"
79+
target_triplet: x64-linux
7780

7881
- name: "macOS x64 Latest Clang"
7982
os: macos-13
80-
artifact: "plugin_flac_macos_clang_x64.7z"
8183
archiver: "7za a"
84+
target_triplet: x64-osx
8285

8386
- name: "macOS arm64 Latest Clang"
8487
os: macos-14
85-
artifact: "plugin_flac_macos_clang_arm64.7z"
8688
archiver: "7za a"
89+
target_triplet: arm64-osx
8790

8891
steps:
8992
- name: Check out code
@@ -94,19 +97,22 @@ jobs:
9497
with:
9598
enableCrossOsArchive: true
9699
path: sdk
97-
key: ${{ matrix.build_type }}-${{ matrix.config.artifact }}-${{ hashFiles('**/sdk') }}
100+
key: ${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}-${{ hashFiles('**/sdk') }}
98101
restore-keys: |
99-
${{ matrix.build_type }}-${{ matrix.config.artifact }}-
102+
${{ matrix.build_type }}-plugin_flac-${{ matrix.config.target_triplet }}-
100103
101104
- name: Pack
102105
shell: bash
103-
run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_${{ matrix.config.artifact }} LICENSE NOTICE README.md sdk
106+
run: ${{ matrix.config.archiver }} ./${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z LICENSE README.md sdk
104107

105108
- name: Upload
106109
uses: actions/upload-artifact@v4
107110
with:
108-
path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }}
109-
name: ${{ matrix.build_type }}_${{ matrix.config.artifact }}
111+
path: |
112+
LICENSE
113+
README.md
114+
sdk/
115+
name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}
110116

111117
- name: Upload release asset
112118
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
@@ -115,6 +121,6 @@ jobs:
115121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116122
with:
117123
upload_url: ${{ github.event.release.upload_url }}
118-
asset_path: ./${{ matrix.build_type }}_${{ matrix.config.artifact }}
119-
asset_name: ${{ matrix.build_type }}_${{ matrix.config.artifact }}.zip
120-
asset_content_type: application/zip
124+
asset_path: ./${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z
125+
asset_name: ${{ matrix.build_type }}_plugin_flac_${{ matrix.config.target_triplet }}.7z
126+
asset_content_type: application/x-7z-compressed

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ cmake_minimum_required(VERSION 3.20)
1616

1717
cmake_policy(SET CMP0048 NEW)
1818

19-
list(APPEND CMAKE_MODULE_PATH "$ENV{AM_SDK_PATH}/cmake" "${AM_SDK_PATH}/cmake")
20-
list(APPEND CMAKE_PREFIX_PATH "$ENV{AM_SDK_PATH}/cmake" "${AM_SDK_PATH}/cmake")
19+
if(EXISTS $ENV{AM_SDK_PATH})
20+
string(REPLACE "\\" "/" ENV_AM_SDK_PATH $ENV{AM_SDK_PATH})
21+
list(APPEND CMAKE_MODULE_PATH "${ENV_AM_SDK_PATH}/cmake")
22+
list(APPEND CMAKE_PREFIX_PATH "${ENV_AM_SDK_PATH}/cmake")
23+
endif()
2124

25+
list(APPEND CMAKE_MODULE_PATH "${AM_SDK_PATH}/cmake")
26+
list(APPEND CMAKE_PREFIX_PATH "${AM_SDK_PATH}/cmake")
27+
2228
project(AmplitudeFlacCodecPlugin)
2329

2430
set(CMAKE_CXX_STANDARD 20)
@@ -81,7 +87,11 @@ set(AM_INC_DESTINATION "include")
8187

8288
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}")
8389

84-
set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH})
90+
if(NOT AM_BUILDSYSTEM_BUILDING_AMPLITUDE)
91+
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/sdk")
92+
else()
93+
set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH})
94+
endif()
8595

8696
install(
8797
TARGETS ${PROJECT_NAME}

0 commit comments

Comments
 (0)