Skip to content

Create release

Create release #234

Workflow file for this run

on:
create:
ref_type: tag
ref: 'v*'
name: Create release
jobs:
build-release-artifacts:
name: Build artifact
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- artifact: windows-x86_64
os: windows-latest
toolchain-suffix: x86_64-pc-windows-msvc
lib-file-name: helgobox.dll
extension-file-name: reaper_helgobox.dll
target: x86_64-pc-windows-msvc
use-cross: false
profile: release
features: "playtime,egui,licensing"
- artifact: windows-i686
os: windows-latest
toolchain-suffix: i686-pc-windows-msvc
lib-file-name: helgobox.dll
extension-file-name: reaper_helgobox.dll
target: i686-pc-windows-msvc
use-cross: false
profile: release-llvm-out-of-memory-fix
features: "egui"
- artifact: macos-x86_64
os: macos-latest
toolchain-suffix: x86_64-apple-darwin
lib-file-name: libhelgobox.dylib
extension-file-name: libreaper_helgobox.dylib
target: x86_64-apple-darwin
use-cross: false
profile: release
features: "playtime,egui,licensing"
- artifact: macos-aarch64
os: macos-latest
toolchain-suffix: x86_64-apple-darwin
lib-file-name: libhelgobox.dylib
extension-file-name: libreaper_helgobox.dylib
target: aarch64-apple-darwin
use-cross: false
profile: release
features: "playtime,egui,licensing"
- artifact: linux-x86_64
os: ubuntu-20.04
toolchain-suffix: x86_64-unknown-linux-gnu
lib-file-name: libhelgobox.so
extension-file-name: ""
target: x86_64-unknown-linux-gnu
use-cross: false
strip-cmd: strip
profile: release
features: ""
# - artifact: linux-aarch64
# os: ubuntu-22.04
# toolchain-suffix: x86_64-unknown-linux-gnu
# lib-file-name: libhelgobox.so
# extension-file-name: ""
# target: aarch64-unknown-linux-gnu
# use-cross: true
# strip-cmd: aarch64-linux-gnu-strip
# profile: release
# features: ""
# - artifact: linux-armv7
# os: ubuntu-22.04
# toolchain-suffix: x86_64-unknown-linux-gnu
# lib-file-name: libhelgobox.so
# extension-file-name: ""
# target: armv7-unknown-linux-gnueabihf
# use-cross: true
# strip-cmd: arm-linux-gnueabihf-strip
# profile: release
# features: ""
env:
# This is relevant for macOS builds only (and only if not overridden).
# TODO-high This is temporarily 10.9 (should be 10.7) until https://github.com/rust-lang/cc-rs/issues/902 is fixed
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
# Prepare (all)
- name: Checkout
uses: actions/checkout@v2
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.PRIVATE_PLAYTIME_CLIP_ENGINE_DEPLOY_KEY }}
${{ secrets.PRIVATE_HELGOBOSS_LICENSE_PROCESSOR_DEPLOY_KEY }}
- name: Update submodules
run: |
git submodule update --init
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.79.0-${{ matrix.toolchain-suffix }}
target: ${{ matrix.target }}
override: true
# Install OS dependencies (Linux/macOS only)
- name: Install native Linux dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get install nasm php binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu libxdo-dev libx11-dev libxcursor-dev libxcb-dri2-0-dev libxcb-icccm4-dev libx11-xcb-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libspeechd-dev libgtk-3-dev
- run: brew install php
if: matrix.os == 'macos-latest'
# Override SDK root and deployment target (macOS aarch64 only)
- name: Set SDKROOT
if: matrix.target == 'aarch64-apple-darwin'
run: echo "SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)" >> $GITHUB_ENV
- name: Set MACOSX_DEPLOYMENT_TARGET
if: matrix.target == 'aarch64-apple-darwin'
run: echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)" >> $GITHUB_ENV
# Generate dialogs outside of Docker containers in cross builds because PHP is not available in container.
# TODO-high-performance Update: Actually, now it is ... I added it to Cross.toml. So I guess we can remove this.
- name: cargo test (for generating dialogs with php)
if: matrix.use-cross == true
uses: actions-rs/cargo@v1
env:
RUST_MIN_STACK: 5242880
with:
command: test
args: --features "${{ matrix.features }}"
# Build (all)
- name: Build release
uses: actions-rs/cargo@v1
env:
PLAYTIME_AUTHENTICITY_SIGNING_KEY: "${{ secrets.PLAYTIME_AUTHENTICITY_SIGNING_KEY }}"
PLAYTIME_LICENSE_VERIFYING_KEY: "${{ secrets.PLAYTIME_LICENSE_VERIFYING_KEY }}"
PLAYTIME_PRESET_VERIFYING_KEY: "${{ secrets.PLAYTIME_PRESET_VERIFYING_KEY }}"
with:
command: build
args: --features "${{ matrix.features }}" --profile ${{ matrix.profile }} --target ${{ matrix.target }}
use-cross: ${{ matrix.use-cross }}
# Strip debug symbols (Linux and macOS)
# TODO-medium We could replace this with Cargo's recent built-in strip function
- name: Strip debug symbols from Linux binary
if: startsWith(matrix.os, 'ubuntu-')
run: |
cp target/${{ matrix.target }}/${{ matrix.profile }}/${{ matrix.lib-file-name }} target/${{ matrix.target }}/${{ matrix.profile }}/libhelgobox-debug.so
${{ matrix.strip-cmd }} target/${{ matrix.target }}/${{ matrix.profile }}/${{ matrix.lib-file-name }}
- name: Strip debug symbols from macOS binary
if: matrix.os == 'macos-latest'
run: |
strip -u -r target/${{ matrix.target }}/${{ matrix.profile }}/${{ matrix.lib-file-name }}
# Upload plug-in (all)
- name: Upload plug-in to artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/${{ matrix.profile }}/${{ matrix.lib-file-name }}
# Upload extension (macOS and Windows only for now)
- name: Upload extension to artifact
if: matrix.extension-file-name != ''
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/${{ matrix.profile }}/${{ matrix.extension-file-name }}
# Upload debug symbols (all)
- name: Upload Windows debug symbols to artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/${{ matrix.profile }}/helgobox.pdb
- name: Upload macOS debug symbols to artifact
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/${{ matrix.profile }}/deps/libhelgobox.dylib.dSYM/
- name: Upload Linux debug symbols to artifact
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/${{ matrix.profile }}/libhelgobox-debug.so
create-release:
name: Publish release
needs: build-release-artifacts
runs-on: ubuntu-22.04
steps:
- name: Get tag name
id: get_tag_name
run: echo ::set-output name=TAG_NAME::${GITHUB_REF/refs\/tags\//}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_tag_name.outputs.TAG_NAME }}
release_name: ${{ steps.get_tag_name.outputs.TAG_NAME }}
draft: true
prerelease: ${{ contains(github.ref, 'pre') }}
- name: Download artifacts from build job
uses: actions/download-artifact@v2
# Upload Windows x86_64 artifacts
- name: Upload windows-x86_64 release artifact 1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-x86_64/helgobox.dll
asset_name: helgobox-windows-x86_64.dll
asset_content_type: application/octet-stream
- name: Upload windows-x86_64 release artifact 2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-x86_64/reaper_helgobox.dll
asset_name: reaper_helgobox-windows-x86_64.dll
asset_content_type: application/octet-stream
# Upload Windows i686 artifacts
- name: Upload windows-i686 release artifact 1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-i686/helgobox.dll
asset_name: helgobox-windows-i686.dll
asset_content_type: application/octet-stream
- name: Upload windows-i686 release artifact 2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-i686/reaper_helgobox.dll
asset_name: reaper_helgobox-windows-i686.dll
asset_content_type: application/octet-stream
# Upload macOS x86_64 artifacts
- name: Upload macos-x86_64 release artifact 1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos-x86_64/libhelgobox.dylib
asset_name: helgobox-macos-x86_64.vst.dylib
asset_content_type: application/octet-stream
- name: Upload macos-x86_64 release artifact 2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos-x86_64/libreaper_helgobox.dylib
asset_name: reaper_helgobox-macos-x86_64.dylib
asset_content_type: application/octet-stream
# Upload macOS aarch64 artifacts
- name: Upload macos-aarch64 release artifact 1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos-aarch64/libhelgobox.dylib
asset_name: helgobox-macos-aarch64.vst.dylib
asset_content_type: application/octet-stream
- name: Upload macos-aarch64 release artifact 2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos-aarch64/libreaper_helgobox.dylib
asset_name: reaper_helgobox-macos-aarch64.dylib
asset_content_type: application/octet-stream
# Upload Linux x86_64 artifacts
- name: Upload linux-x86_64 release artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux-x86_64/libhelgobox.so
asset_name: helgobox-linux-x86_64.so
asset_content_type: application/octet-stream
# Upload Linux aarch64 artifacts
# - name: Upload linux-aarch64 release artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./linux-aarch64/libhelgobox.so
# asset_name: helgobox-linux-aarch64.so
# asset_content_type: application/octet-stream
# Upload Linux armv7 artifacts
# - name: Upload linux-armv7 release artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./linux-armv7/libhelgobox.so
# asset_name: helgobox-linux-armv7.so
# asset_content_type: application/octet-stream