Release #22
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
name: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-2019] | |
arch: [x64, arm64] | |
node-version: [20.x] | |
exclude: | |
- os: windows-2019 | |
arch: arm64 | |
- os: ubuntu-latest | |
arch: arm64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.x" | |
- name: Update cmake | |
if: matrix.os != 'macos-latest' | |
run: | | |
pip install cmake | |
cmake --version | |
- name: Setup environment | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew update | |
brew upgrade cmake | |
cmake --version | |
- name: Installing codesign certificates | |
if: matrix.os == 'macos-latest' | |
uses: apple-actions/import-codesign-certs@v2 | |
with: | |
p12-file-base64: ${{ secrets.APPLE_CERT_DATA }} | |
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }} | |
- name: Install SFML native dependencies | |
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y desktop-file-utils libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev pkg-config | |
- name: Replace repositories with amd64 and arm64 repositories | |
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' | |
run: | | |
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list | |
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=amd64] http://archive.canonical.com/ubuntu/ jammy partner" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list | |
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
- name: Install cross-compilation to arm on linux dependencies | |
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' | |
run: | | |
sudo apt-get remove libgpg-error-dev | |
sudo dpkg --add-architecture arm64 | |
sudo apt-get update | |
sudo apt-get install -y desktop-file-utils ninja-build gcc-aarch64-linux-gnu:amd64 g++-aarch64-linux-gnu:amd64 python3-jinja2:amd64 libgcrypt20:arm64 libgcrypt20-dev:arm64 libgpg-error-dev:arm64 libx11-dev:arm64 libxrandr-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libudev-dev:arm64 libgl1-mesa-dev:arm64 | |
- name: Install dependencies and building backend (x64) | |
if: matrix.arch == 'x64' | |
run: | | |
npm -g i cmake-js | |
cd backend/ | |
npm install | |
cmake-js compile -B Release -a x64 | |
node custom_build.mjs | |
npm pack | |
cd .. | |
npm install ./backend/trackaudio-afv-1.0.0.tgz | |
npm install | |
- name: Install dependencies and building backend (macOs arm64) | |
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest' | |
run: | | |
npm -g i cmake-js | |
cd backend/ | |
npm install | |
cmake-js compile -B Release -a arm64 | |
node custom_build.mjs | |
npm pack | |
cd .. | |
npm install ./backend/trackaudio-afv-1.0.0.tgz | |
npm install | |
- name: Install dependencies and building backend (linux arm64 cross compile) | |
if: matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest' | |
run: | | |
npm -g i cmake-js | |
cd backend/ | |
npm install | |
cmake-js compile -B Release -a arm64 --prefer-clang false --CD -DVCPKG_TARGET_TRIPLET=arm64-linux | |
node custom_build.mjs | |
npm pack | |
cd .. | |
npm install ./backend/trackaudio-afv-1.0.0.tgz | |
npm install | |
- name: Package app | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# env: | |
# APPLE_ID: ${{ secrets.APPLE_ID }} | |
# APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} | |
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
run: npm run make -- --arch ${{ matrix.arch }} | |
- name: Make AppImage | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
chmod +x ./scripts/make_appimage.sh | |
cp ./scripts/make_appimage.sh ./ | |
./make_appimage.sh ${{ matrix.arch }} | |
- id: relinfo | |
uses: pozetroninc/github-action-get-latest-release@master | |
with: | |
repository: pierr3/TrackAudio | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifacts | |
uses: softprops/action-gh-release@v2 | |
if: matrix.os == 'windows-2019' && always() | |
with: | |
tag_name: ${{ steps.relinfo.outputs.release }} | |
files: "out/make/**/*.exe" | |
- name: Upload artifacts | |
uses: softprops/action-gh-release@v2 | |
if: matrix.os == 'macos-latest' | |
with: | |
tag_name: ${{ steps.relinfo.outputs.release }} | |
files: "out/make/**/*.dmg" | |
- name: Upload artifacts | |
uses: softprops/action-gh-release@v2 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
tag_name: ${{ steps.relinfo.outputs.release }} | |
files: | | |
out/make/**/*.deb | |
*.AppImage | |
*.zsync |