Skip to content

Commit

Permalink
Set up GitHub Workflows and update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelgk committed Aug 18, 2021
1 parent 184519a commit b805a70
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 36 deletions.
122 changes: 122 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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/[email protected]
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 }}
32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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

20 changes: 0 additions & 20 deletions package-info.json

This file was deleted.

25 changes: 25 additions & 0 deletions package-info.json.in
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit b805a70

Please sign in to comment.