From b805a700e252d3d5cf2134e6a1507a07e966f9ed Mon Sep 17 00:00:00 2001 From: Isabel Kaspriskie Date: Fri, 9 Jul 2021 17:15:05 -0400 Subject: [PATCH] Set up GitHub Workflows and update .gitignore --- .github/workflows/main.yml | 122 +++++++++++++++++++++++++++++++++++++ .gitignore | 32 +++++----- package-info.json | 20 ------ package-info.json.in | 25 ++++++++ 4 files changed, 163 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 package-info.json create mode 100644 package-info.json.in diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..319a765 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,122 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + package: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest] + config: [debug, release] + + steps: + - uses: actions/checkout@v2 + 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 .. + + - name: configure_windows + if: matrix.os == 'windows-latest' + run: mkdir build && cd build && cmake .. + + - name: build_debug + if: matrix.config == 'debug' + run: cmake --build build --config 'Debug' + + - name: build_release + if: matrix.config == 'release' + run: cmake --build build --config 'Release' + + - name: test + run: cd build && ctest -C ${{ matrix.config }} . -V + + - name: package_macos + if: matrix.os == 'macos-latest' + env: + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_SHA: ${{ github.sha }} + GITHUB_CONFIG: ${{ matrix.config }} + run: | + PACKAGE_NAME=`echo $GITHUB_REPOSITORY | sed 's/.*\///g'` + PACKAGE_REV=`echo $GITHUB_SHA | sed -e 's/^[[:alnum:]]\{7\}/&-/g' | sed 's/-.*//'` + PACKAGE_CONFIG=`echo $GITHUB_CONFIG` + mkdir -p $PACKAGE_NAME + if [ -e package-info.json ]; then cp package-info.json $PACKAGE_NAME; fi + if [ -e package-info.json.in ]; then cp package-info.json.in $PACKAGE_NAME; fi + if [ -e LICENSE ]; then cp LICENSE.md $PACKAGE_NAME; fi + for f in *.md; do [ -e "$f" ] && cp "$f" $PACKAGE_NAME ; done + if [ -e icon.png ]; then cp icon.png $PACKAGE_NAME; fi + if [ -e CMakeLists.txt ]; then cp CMakeLists.txt $PACKAGE_NAME; fi + if [ -d docs ]; then cp -r docs $PACKAGE_NAME; fi + if [ -d examples ]; then cp -r examples $PACKAGE_NAME; fi + if [ -d externals ]; then cp -r externals $PACKAGE_NAME; fi + 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 media ]; then cp -r media $PACKAGE_NAME; fi + if [ -d patchers ]; then cp -r patchers $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 + if: matrix.os == 'windows-latest' + shell: cmd + env: + GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} + GITHUB_CONFIG: ${{ matrix.config }} + run: | + set PACKAGE_NAME=%GITHUB_REPOSITORY_NAME% + mkdir %PACKAGE_NAME% + if exist extensions cp -r extensions %PACKAGE_NAME% + if exist externals cp -r externals %PACKAGE_NAME% + if exist support cp -r support %PACKAGE_NAME% + if exist tests cp -r tests %PACKAGE_NAME% + + - uses: actions/upload-artifact@v2 + with: + name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-${{ matrix.config }} + path: ${{ github.event.repository.name }} + + release: + runs-on: ubuntu-latest + needs: package + if: ${{ contains( github.ref, 'refs/tags/' ) }} + + steps: + - uses: benjlevesque/short-sha@v1.1 + id: short-sha + with: + length: 7 + + - uses: actions/download-artifact@v2 + with: + name: ${{ github.event.repository.name }}-${{ steps.short-sha.outputs.sha }}-release + path: ${{ github.event.repository.name }} + + - name: Display structure of downloaded files + run: ls -R + 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 }} + + - 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 + + - uses: ncipollo/release-action@v1.7.1 + with: + artifacts: ${{ github.event.repository.name }}-package-for-max-${{ steps.short-sha.outputs.sha }}.zip + body: "Max Package for all supported platforms" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 2cea255..1f270de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,19 @@ -.DS_Store -build/ -*.pbxuser -*.mode1v3 -xcuserdata -*.xcworkspace -*.tm_build_errors -*.ncb -*.suo -*.vcproj.* -*.wwdb -*.user +__* +sysbuild *.sdf -ipch +*.suo +*.sln *.opensdf - +log.txt externals -temp -sysbuild +extensions +support +build +tests +*.o +*.dylib +tmp +.DS_Store +.vs +package-info.json + diff --git a/package-info.json b/package-info.json deleted file mode 100644 index aaf126c..0000000 --- a/package-info.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "PeRColate", - "author": "Luke DuBois and Dan Trueman", - "description": "A collection of synthesis, signal processing, and image processing objects originally authored by Dan Trueman and Luke Dubois.", - "homepatcher": "PeRColate.maxpat", - "max_version_min" : "8.0", "max_version_max" : "none", - "os" : { - "macintosh" : { - "platform" : [ "x64" ], - "min_version" : "10.9" - }, - "windows" : { - "platform" : [ "x64" ], - "min_version" : "none" - } - }, - "tags": ["synthesis", "physical modeling"], - "version": "1.3.0", - "website": "https://github.com/Cycling74/percolate" -} \ No newline at end of file diff --git a/package-info.json.in b/package-info.json.in new file mode 100644 index 0000000..d49c86f --- /dev/null +++ b/package-info.json.in @@ -0,0 +1,25 @@ +{ + "name": "PeRColate", + "author" : "Luke DuBois, Dan Trueman, Cycling '74", + "description" : "A collection of synthesis, signal processing, and image processing objects originally authored by Dan Trueman and Luke Dubois.", + "homepatcher" : "PeRColate.maxpat", + "max_version_min" : "8.0", "max_version_max" : "none", + "name" : "@C74_PACKAGE_NAME@", + "os" : { + "macintosh" : { + "platform" : [ "x64" ], + "min_version" : "none" + }, + "windows" : { + "platform" : [ "x64" ], + "min_version" : "none" + } + }, + "package_extra" : { + "reverse_domain" : "com.cycling74", + "copyright" : "Copyright (c) 2018 Cycling '74" + }, + "tags" : ["synthesis", "physical modeling"], + "version" : "@GIT_VERSION_MAJ@.@GIT_VERSION_MIN@.@GIT_VERSION_SUB@", + "website" : "http://www.github.com/Cycling74/percolate" +}