Skip to content

Release

Release #34

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
stage:
description: Target plugin build stage
required: true
type: choice
default: production
options:
- production
- beta
env:
BUILD_TYPE: Release
PLUGIN_NAME: Rotor
BUNDLE_ID: com.bbx-audio.rotor
VERSION: 1.0.0
jobs:
Build:
name: Build Release (${{ matrix.name }})
uses: ./.github/workflows/build.reusable.yml
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-13
# - name: Windows
# os: windows-2022
with:
os: ${{ matrix.os }}
build_type: Release
upload_artifacts: ${{ true }}
Package:
name: Package (${{ matrix.name }})
runs-on: ${{ matrix.os }}
needs: [ Build ]
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-13
# - name: Windows
# os: windows-2022
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.PLUGIN_NAME }}-${{ matrix.name }}
# - name: Delete Artifacts
# uses: geekyeggo/delete-artifact@v5
# with:
# name: ${{ env.PLUGIN_NAME }}-${{ matrix.name }}
- name: Set Environment Variables
run: |
ls
ls ${{ env.PLUGIN_NAME }}-${{ matrix.name }} || echo "No dir"
ARTIFACTS_PATH=${{ env.PLUGIN_NAME }}-${{ matrix.name }}
echo "VST3_PATH=$ARTIFACTS_PATH/${{ env.PLUGIN_NAME }}.vst3" >> $GITHUB_ENV
echo "AU_PATH=$ARTIFACTS_PATH/${{ env.PLUGIN_NAME }}.component" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ env.PLUGIN_NAME }} v${{ env.VERSION }} (${{ runner.os }})" >> $GITHUB_ENV
- name: Import Certificates (MacOS)
uses: apple-actions/import-codesign-certs@v3
if: ${{ matrix.name == 'macOS' }}
with:
p12-file-base64: ${{ secrets.DEVELOPER_ID_CERTIFICATIONS }}
p12-password: ${{ secrets.DEVELOPER_ID_CERTIFICATIONS_PASSWORD }}
- name: Sign Binaries (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: |
codesign --force -s "${{ secrets.DEVELOPER_ID_APP }}" -v "${{ env.VST3_PATH }}" --deep --strict --options=runtime --timestamp
codesign --verify --deep --strict --verbose=2 "${{ env.VST3_PATH }}"
codesign --force -s "${{ secrets.DEVELOPER_ID_APP }}" -v "${{ env.AU_PATH }}" --deep --strict --options=runtime --timestamp
codesign --verify --deep --strict --verbose=2 "${{ env.AU_PATH }}"
- name: Download Packages (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: wget http://s.sudre.free.fr/Software/files/Packages.dmg
- name: Mount Packages (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: hdiutil attach Packages.dmg
- name: Install Packages (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: sudo installer -pkg /Volumes/Packages\ 1.2.10/Install\ Packages.pkg -target /
- name: Build Installer (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: packagesbuild packaging/Rotor.pkgproj
- name: Sign Installer (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: |
mkdir -p packaging/build/signed
productsign -s "${{ secrets.DEVELOPER_ID_INSTALLER }}" "packaging/build/${{ env.PLUGIN_NAME }}.pkg" "packaging/build/signed/${{ env.PLUGIN_NAME }}.pkg"
pkgutil --check-signature "packaging/build/signed/${{ env.PLUGIN_NAME }}.pkg"
- name: Package Installer (MacOS)
if: ${{ matrix.name == 'macOS' }}
run: |
# Setup tools and directories
python3 -m pip install setuptools --break-system-packages
npm install -g appdmg
mkdir -p packaging/dmg
mv packaging/build/signed/${{ env.PLUGIN_NAME }}.pkg packaging/dmg
# Create the .dmg
cd packaging && appdmg dmg.json "${{ env.ARTIFACT_NAME }}.dmg"
codesign -s "${{ secrets.DEVELOPER_ID_APP }}" --timestamp -i ${{ env.BUNDLE_ID }} --force "${{ env.ARTIFACT_NAME }}.dmg"
xcrun notarytool submit "${{ env.ARTIFACT_NAME }}.dmg" --apple-id ${{ secrets.APPLE_NOTARIZATION_USERNAME }} --password ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} --team-id ${{ secrets.DEVELOPER_TEAM_ID }} --wait
xcrun stapler staple "${{ env.ARTIFACT_NAME }}.dmg"
- name: Upload DMG (MacOS)
if: ${{ matrix.name == 'macOS' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: packaging/${{ env.ARTIFACT_NAME }}.dmg
Release:
if: startsWith(github.event.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [ Package ]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Draft Release
uses: softprops/actions-gh-release@v2
with:
prerelease: ${{ inputs.stage != 'production' }}
files: |
*/*.dmg