Skip to content

Release

Release #35

Workflow file for this run

name: Release
on:
create:
tags:
- v*
workflow_dispatch:
jobs:
package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
config: [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 .. "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
- 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
# 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 [ -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
if [ -d extensions ]; then cp -r extensions $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 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
if [ -d jsextensions ]; then cp -r jsextensions $PACKAGE_NAME; fi
if [ -d jsui ]; then cp -r jsui $PACKAGE_NAME; fi
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 [ -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
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: '0'
- uses: battila7/get-version-action@v2
id: get_version
- 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.get_version.outputs.version }}.zip ${{ github.event.repository.name }}
- uses: actions/upload-artifact@v2
with:
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
with:
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 }}