-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continuous Integration tests on GitHub Actions
- Loading branch information
Showing
9 changed files
with
359 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Install dependencies | ||
|
||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
sudo apt-get update -qq | ||
sudo apt-get install g++-8 xvfb libsndfile1-dev libsamplerate0-dev libasound2-dev libxpm-dev libpulse-dev libjack-dev libxft-dev libxrandr-dev libx11-dev libxinerama-dev libxcursor-dev libfontconfig1-dev libfltk1.3-dev librtmidi-dev | ||
|
||
# Symlink gcc in order to use the latest version | ||
|
||
sudo ln -f -s /usr/bin/g++-8 /usr/bin/g++ | ||
|
||
# Download linuxdeploy for building AppImages | ||
|
||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||
chmod a+x linuxdeploy-x86_64.AppImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "Create working dirs" | ||
|
||
mkdir dist | ||
mkdir temp | ||
|
||
echo "Strip binary and move it to temp/" | ||
|
||
strip ./build/giada | ||
mv ./build/giada temp/ | ||
|
||
echo "Create .desktop file" | ||
|
||
cat << EOF > ./temp/giada.desktop | ||
[Desktop Entry] | ||
Name=Giada | ||
Name[es]=Giada | ||
GenericName=Drum machine and loop sequencer | ||
GenericName[es]=Caja de ritmos y secuenciador de loops | ||
Icon=giada | ||
Type=Application | ||
Exec=giada | ||
Terminal=false | ||
Categories=AudioVideo;Audio;X-Digital_Processing;X-Jack;X-MIDI;Midi; | ||
Keywords=Giada; | ||
EOF | ||
|
||
echo "Prepare logo" | ||
|
||
mv extras/giada-logo.svg temp/giada.svg | ||
|
||
# Run linuxdeploy to make the AppImage, then move it to dist/ dir. | ||
# For some reason linuxdeploy uses the commit hash in the filename, so | ||
# rename it first. Note: $RELEASE_VERSION is an environment variable set in the | ||
# packaging.yml script. | ||
|
||
./linuxdeploy-x86_64.AppImage -e temp/giada -d temp/giada.desktop -i temp/giada.svg --output appimage --appdir temp/ | ||
mv Giada-*-x86_64.AppImage Giada-$RELEASE_VERSION-x86_64.AppImage | ||
cp Giada-$RELEASE_VERSION-x86_64.AppImage dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
brew update > /dev/null | ||
brew install rtmidi | ||
brew install libsamplerate | ||
brew install fltk | ||
brew install libsndfile | ||
brew install upx | ||
|
||
# Remove dynamic libraries to force static linking. | ||
|
||
rm -rf /usr/local/lib/librtmidi*dylib | ||
rm -rf /usr/local/lib/libsamplerate*dylib | ||
rm -rf /usr/local/lib/libfltk*dylib | ||
rm -rf /usr/local/lib/libfltk_forms*dylib | ||
rm -rf /usr/local/lib/libfltk_gl*dylib | ||
rm -rf /usr/local/lib/libfltk_images*dylib | ||
rm -rf /usr/local/lib/libsndfile*dylib | ||
rm -rf /usr/local/lib/libFLAC*dylib | ||
rm -rf /usr/local/lib/libogg*dylib | ||
rm -rf /usr/local/lib/libopus*dylib | ||
rm -rf /usr/local/lib/libvorbis*dylib | ||
rm -rf /usr/local/lib/libvorbisenc*dylib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "Create working dirs" | ||
|
||
mkdir dist | ||
mkdir temp | ||
|
||
echo "UPX binary" | ||
|
||
upx --best ./build/Release/giada | ||
|
||
echo "Create temporary directory giada.app" | ||
|
||
mkdir temp/giada.app | ||
mkdir temp/giada.app/Contents | ||
mkdir temp/giada.app/Contents/Resources | ||
mkdir temp/giada.app/Contents/MacOS | ||
echo APPLnone > temp/giada.app/Contents/PkgInfo | ||
|
||
echo "Generate Info.plist file" | ||
|
||
cat << EOF > temp/giada.app/Contents/Info.plist | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> | ||
<plist version="0.9"> | ||
<dict> | ||
<key>CFBundleDisplayName</key> | ||
<string>giada</string> | ||
<key>CFBundleName</key> | ||
<string>giada</string> | ||
<key>CFBundleExecutable</key> | ||
<string>giada</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleIconFile</key> | ||
<string>giada.icns</string> | ||
<key>CFBundleSignature</key> | ||
<string>none</string> | ||
</dict> | ||
</plist> | ||
EOF | ||
|
||
echo "Copy the binary file into the .app bundle" | ||
|
||
mv ./build/Release/giada temp/giada.app/Contents/MacOS/ | ||
|
||
echo "Set executable permissions" | ||
|
||
chmod 755 temp/giada.app/Contents/MacOS/giada | ||
|
||
echo "Copy icon (.icns)" | ||
|
||
cp extras/giada.icns temp/giada.app/Contents/Resources/ | ||
|
||
echo "Copy final bundle to dist/, zip it and clean it up" | ||
|
||
# Note: $RELEASE_VERSION is an environment variable set in the | ||
# packaging.yml script. | ||
|
||
cp -r temp/giada.app dist/ | ||
cd dist | ||
zip -r giada-$RELEASE_VERSION-x86_64-macos.zip giada.app | ||
rm -rf giada.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install Visual Studio 2019 build tools | ||
|
||
choco install -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" | ||
|
||
# Install vcpkg + Giada dependencies | ||
|
||
vcpkg install libsndfile:x64-windows | ||
vcpkg install libsamplerate:x64-windows | ||
vcpkg install fltk:x64-windows | ||
vcpkg install rtmidi:x64-windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "Create working dirs" | ||
|
||
mkdir dist | ||
mkdir temp | ||
|
||
echo "Copy binary and dll files to temp/" | ||
|
||
cp build/Release/giada.exe build/Release/*.dll temp/ | ||
|
||
echo "Make zip archive, save it to to dist/" | ||
|
||
# Note: $RELEASE_VERSION is an environment variable set in the | ||
# packaging.yml script. | ||
|
||
7z a -tzip dist/giada-$RELEASE_VERSION-x86_64-windows.zip ./temp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Continuous integration | ||
|
||
# Runs on push and pull requests, any branch, Linux only (for now). | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
linux-ci: | ||
name: Linux CI | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Download repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: bash ./.github/scripts/linux/install-deps.sh | ||
|
||
- name: Generate Makefile | ||
run: cmake -S . -B build/ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-Wno-class-memaccess -DWITH_SYSTEM_RTMIDI=ON -DWITH_SYSTEM_FLTK=ON -DWITH_SYSTEM_LIBSNDFILE=ON -DWITH_SYSTEM_LIBSAMPLERATE=ON -DWITH_TESTS=ON | ||
|
||
- name: Build | ||
run: cmake --build build/ -j 2 | ||
|
||
- name: Run tests | ||
run: xvfb-run ./build/giada --run-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: Packaging | ||
|
||
# Runs on new tags. | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
# create-release ------------------------------------------------------------- | ||
create-release: | ||
name: Create release | ||
runs-on: ubuntu-18.04 | ||
outputs: # Output contains the upload url. Will be reused on upload release | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Create | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
|
||
# Linux ---------------------------------------------------------------------- | ||
linux: | ||
name: Linux | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 60 | ||
needs: create-release | ||
steps: | ||
- name: Prepare RELEASE_VERSION env variable | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Download repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: bash ./.github/scripts/linux/install-deps.sh | ||
|
||
- name: Generate Makefile | ||
run: cmake -S . -B build/ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-class-memaccess -DWITH_VST3=ON -DWITH_SYSTEM_RTMIDI=ON -DWITH_SYSTEM_FLTK=ON -DWITH_SYSTEM_LIBSNDFILE=ON -DWITH_SYSTEM_LIBSAMPLERATE=ON | ||
|
||
- name: Build | ||
run: cmake --build build/ -j 2 | ||
|
||
- name: Make package | ||
run: bash ./.github/scripts/linux/make-package.sh | ||
|
||
- name: Upload release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/Giada-${{ env.RELEASE_VERSION }}-x86_64.AppImage | ||
asset_name: Giada-${{ env.RELEASE_VERSION }}-x86_64.AppImage | ||
asset_content_type: application/x-executable | ||
|
||
# Windows -------------------------------------------------------------------- | ||
windows: | ||
name: Windows | ||
runs-on: windows-2019 | ||
timeout-minutes: 60 | ||
needs: create-release | ||
steps: | ||
- name: Prepare RELEASE_VERSION env variable | ||
shell: bash | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Download repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: bash ./.github/scripts/windows/install-deps.sh | ||
|
||
- name: Generate Makefile | ||
shell: bash | ||
run: cmake -S . -B build/ -G "Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE=/c/vcpkg/scripts/buildsystems/vcpkg.cmake -DWITH_VST3=ON | ||
|
||
- name: Build | ||
shell: bash | ||
run: cmake --build build/ --config Release -j 2 | ||
|
||
- name: Make package | ||
run: bash ./.github/scripts/windows/make-package.sh | ||
|
||
- name: Upload release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/giada-${{ env.RELEASE_VERSION }}-x86_64-windows.zip | ||
asset_name: giada-${{ env.RELEASE_VERSION }}-x86_64-windows.zip | ||
asset_content_type: application/zip | ||
|
||
# macOS ---------------------------------------------------------------------- | ||
macos: | ||
name: macOS | ||
runs-on: macos-10.15 | ||
timeout-minutes: 60 | ||
needs: create-release | ||
steps: | ||
- name: Prepare RELEASE_VERSION env variable | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Download repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: bash ./.github/scripts/macos/install-deps.sh | ||
|
||
- name: Generate Makefile | ||
run: cmake -S . -B build/ -G "Xcode" -DCMAKE_CXX_FLAGS="-x objective-c++" -DWITH_VST3=ON -DWITH_SYSTEM_RTMIDI=ON -DWITH_SYSTEM_FLTK=ON -DWITH_SYSTEM_LIBSNDFILE=ON -DWITH_SYSTEM_LIBSAMPLERATE=ON | ||
|
||
- name: Build | ||
run: cmake --build build/ --config Release -j 2 | ||
|
||
- name: Make package | ||
run: bash ./.github/scripts/macos/make-package.sh | ||
|
||
- name: Upload release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/giada-${{ env.RELEASE_VERSION }}-x86_64-macos.zip | ||
asset_name: giada-${{ env.RELEASE_VERSION }}-x86_64-macos.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters