Skip to content

Release

Release #41

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
environment: Release
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
- name: Checkout submodules
shell: bash
run: |
git submodule update --init --remote backend/vcpkg
git submodule update --init --remote backend/extern/afv-native
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Python 3.x
uses: actions/setup-python@v5
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@v3
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
if: matrix.os == 'windows-2019'
shell: bash
run: npm run build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install notarization tools
if: matrix.os == 'macos-latest'
run: |
cat << EOF > ./.a.p8
${{ secrets.APPLE_API_KEY }}
EOF
- name: Package app
if: matrix.os == 'macos-latest'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_API_KEY: "./.a.p8"
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: |
npm run build:mac -- --${{ matrix.arch }}
rm ./.a.p8
- name: Package app
if: matrix.os == 'ubuntu-latest'
shell: bash
run: npm run build:linux -- --${{ matrix.arch }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename installer to human friendly name
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: |
cd dist/
dmg_file=$(find . -name "*.dmg" -type f)
new_dmg_file=$(echo $dmg_file | sed 's/arm64/apple-silicon/')
mv $dmg_file $new_dmg_file
- 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'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: |
dist/*.exe
dist/*.zip
- name: Upload artifacts
uses: softprops/action-gh-release@v2
if: matrix.os == 'macos-latest'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: "dist/*.dmg"
- name: Upload artifacts
uses: softprops/action-gh-release@v2
if: matrix.os == 'ubuntu-latest'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: |
dist/*.deb
dist/*.AppImage
dist/*.zsync
dist/*.snap