Skip to content

Commit

Permalink
Add github action for automatic release builds (#7)
Browse files Browse the repository at this point in the history
add github action for automatic release builds
  • Loading branch information
antonok-edm authored Nov 3, 2021
1 parent c499a03 commit 651bb00
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- "v*"

env:
CARGO_TERM_COLOR: always

jobs:
create_release:
name: Create release
runs-on: macos-latest
outputs:
id: ${{ steps.draft_release.outputs.id }}
html_url: ${{ steps.draft_release.outputs.html_url }}
upload_url: ${{ steps.draft_release.outputs.upload_url }}
steps:
- name: Draft release
id: draft_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true

build_release:
name: Build release
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
name: linux
arch: x86-64
asset_path: ./target/release/libampli_fe.so
plugin_ext: .so
- os: macos-latest
name: macos
arch: x86-64
asset_path: ./ampli-Fe.vst
plugin_ext: .vst
- os: windows-latest
name: windows
arch: x86-64
asset_path: ./target/release/ampli_fe.dll
plugin_ext: .dll
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install zip on Windows
if: matrix.os == 'windows-latest'
shell: bash
run: choco install zip
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Bundle macOS plugin
if: matrix.os == 'macos-latest'
shell: bash
run: ./bundle_macos.sh
- name: Move Linux and Windows plugins
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
shell: bash
run: mv ${{ matrix.asset_path }} ./ampli-Fe${{ matrix.plugin_ext }}
- name: Create plugin zip archive
shell: bash
run: |
zip -r ampli-Fe.zip ./ampli-Fe${{ matrix.plugin_ext }}
- name: Upload plugin archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./ampli-Fe.zip
asset_name: ampli-Fe_${{ matrix.name }}-${{ matrix.arch }}.zip
asset_content_type: application/octet-stream

0 comments on commit 651bb00

Please sign in to comment.