From 988e37faa9ba50354a0a266797022abfddb13105 Mon Sep 17 00:00:00 2001 From: Robert Ramirez Date: Thu, 12 Aug 2021 15:15:33 -0400 Subject: [PATCH] update to latest sdk and workflows --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++------------ .github/workflows/test.yml | 46 +++++++++++++++++++++++++++++++++ CMakeLists.txt | 12 ++------- source/min-api | 2 +- source/min-lib | 2 +- 5 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78ea9fe..8d785a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,10 @@ -name: CI +name: Release -on: [push, pull_request] +on: + create: + tags: + - v* + workflow_dispatch: jobs: package: @@ -8,19 +12,22 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - config: [debug, release] + config: [release] steps: - uses: actions/checkout@v2 - - - uses: benjlevesque/short-sha@v1.1 + with: + submodules: 'recursive' + fetch-depth: '0' + + - uses: benjlevesque/short-sha@v1.2 id: short-sha with: length: 7 - name: configure_macos if: matrix.os == 'macos-latest' - run: mkdir build && cd build && cmake -G Xcode .. + run: mkdir build && cd build && cmake -G Xcode .. "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" - name: configure_windows if: matrix.os == 'windows-latest' @@ -49,9 +56,12 @@ jobs: PACKAGE_CONFIG=`echo $GITHUB_CONFIG` mkdir -p $PACKAGE_NAME if [ -e package-info.json ]; then cp package-info.json $PACKAGE_NAME; fi - for f in *.md; do [ -e "$f" ] && cp "$f" $PACKAGE_NAME ; done + # if [ -e package-info.json.in ]; then cp package-info.json.in $PACKAGE_NAME; fi + # for f in *.md; do [ -e "$f" ] && cp "$f" $PACKAGE_NAME ; done + if [ -e License.md ]; then cp License.md $PACKAGE_NAME; fi + if [ -e ReadMe.md ]; then cp ReadMe.md $PACKAGE_NAME; fi if [ -e icon.png ]; then cp icon.png $PACKAGE_NAME; fi - if [ -e CMakeLists.txt ]; then cp CMakeLists.txt $PACKAGE_NAME; fi + # if [ -e CMakeLists.txt ]; then cp CMakeLists.txt $PACKAGE_NAME; fi if [ -d code ]; then cp -r code $PACKAGE_NAME; fi if [ -d docs ]; then cp -r docs $PACKAGE_NAME; fi if [ -d examples ]; then cp -r examples $PACKAGE_NAME; fi @@ -60,6 +70,7 @@ jobs: if [ -d extras ]; then cp -r extras $PACKAGE_NAME; fi if [ -d help ]; then cp -r help $PACKAGE_NAME; fi if [ -d init ]; then cp -r init $PACKAGE_NAME; fi + if [ -d interfaces ]; then cp -r interfaces $PACKAGE_NAME; fi if [ -d java-classes ]; then cp -r java-classes $PACKAGE_NAME; fi if [ -d java-doc ]; then cp -r java-doc $PACKAGE_NAME; fi if [ -d javascript ]; then cp -r javascript $PACKAGE_NAME; fi @@ -67,9 +78,10 @@ jobs: if [ -d media ]; then cp -r media $PACKAGE_NAME; fi if [ -d misc ]; then cp -r misc $PACKAGE_NAME; fi if [ -d patchers ]; then cp -r patchers $PACKAGE_NAME; fi + if [ -d script ]; then cp -r script $PACKAGE_NAME; fi if [ -d support ]; then cp -r support $PACKAGE_NAME; fi - if [ -d source ]; then cp -r source $PACKAGE_NAME; fi - if [ -d tests ]; then cp -r tests $PACKAGE_NAME; fi + # if [ -d source ]; then cp -r source $PACKAGE_NAME; fi + # if [ -d tests ]; then cp -r tests $PACKAGE_NAME; fi if [ -e $PACKAGE_NAME/ReadMe-Public.md ]; then rm -f $PACKAGE_NAME/ReadMe.md; mv $PACKAGE_NAME/ReadMe-Public.md $PACKAGE_NAME/ReadMe.md; fi - name: package_windows @@ -94,10 +106,17 @@ jobs: release: runs-on: ubuntu-latest needs: package - if: ${{ contains( github.ref, 'refs/tags/' ) }} steps: - - uses: benjlevesque/short-sha@v1.1 + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + fetch-depth: '0' + + - uses: battila7/get-version-action@v2 + id: get_version + + - uses: benjlevesque/short-sha@v1.2 id: short-sha with: length: 7 @@ -112,15 +131,15 @@ jobs: working-directory: ${{ github.event.repository.name }} - name: zip - run: zip -r ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip ${{ github.event.repository.name }} + run: zip -r ${{ github.event.repository.name }}-package-for-max-${{ steps.get_version.outputs.version }}.zip ${{ github.event.repository.name }} - uses: actions/upload-artifact@v2 with: - name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-zipped-release - path: ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip + name: ${{ github.event.repository.name }}-${{ steps.get_version.outputs.version }}-zipped-release + path: ${{ github.event.repository.name }}-package-for-max-${{ steps.get_version.outputs.version }}.zip - - uses: ncipollo/release-action@v1.7.1 + - uses: ncipollo/release-action@v1 with: - artifacts: ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip + artifacts: ${{ github.event.repository.name }}-package-for-max-${{ steps.get_version.outputs.version }}.zip body: "Max Package for all supported platforms" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..48d9ee5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: Test + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + workflow_dispatch: + +jobs: + test: + name: Build and test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + fetch-depth: '0' + + - name: Configure macOS + if: matrix.os == 'macos-latest' + run: mkdir build && cd build && cmake -G Xcode .. + + - name: Configure Windows + if: matrix.os == 'windows-latest' + run: mkdir build && cd build && cmake .. + + - name: Build Debug + run: cmake --build build --config 'Debug' + + - name: Test Debug + run: cd build && ctest -C 'Debug' . -V + + - name: Build Release + run: cmake --build build --config 'Release' + + - name: Test Release + run: cd build && ctest -C 'Release' . -V diff --git a/CMakeLists.txt b/CMakeLists.txt index 893f2a5..f1cac7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,16 +1,7 @@ -cmake_minimum_required(VERSION 3.16) - -if (APPLE) - set (CMAKE_OSX_DEPLOYMENT_TARGET "10.11") -endif () - - -project(Min-DevKit) - +cmake_minimum_required(VERSION 3.19) string(REGEX REPLACE "(.*)/" "" THIS_PACKAGE_NAME "${CMAKE_CURRENT_SOURCE_DIR}") - if (${CMAKE_GENERATOR} MATCHES "Xcode") if (${XCODE_VERSION} VERSION_LESS 10) message(STATUS "Xcode 10 or higher is required. Please install from the Mac App Store.") @@ -18,6 +9,7 @@ if (${CMAKE_GENERATOR} MATCHES "Xcode") endif () endif () +set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") # Fetch the correct version of the min-api message(STATUS "Updating Git Submodules") diff --git a/source/min-api b/source/min-api index f34cede..c162593 160000 --- a/source/min-api +++ b/source/min-api @@ -1 +1 @@ -Subproject commit f34cedef103ba5f30a1a02cfa0a995508b710036 +Subproject commit c16259323b1ea16439cf6a648994c1154668fcc7 diff --git a/source/min-lib b/source/min-lib index 431bdb4..050ccc1 160000 --- a/source/min-lib +++ b/source/min-lib @@ -1 +1 @@ -Subproject commit 431bdb491fa2de2953aa4e5600a0e5f62f5b67ba +Subproject commit 050ccc10e4587219854242e2e0b42ef8e851bf05