Skip to content

Release Assets

Release Assets #15

Workflow file for this run

name: Release Assets
on:
release:
types: [created]
jobs:
release_assets:
strategy:
fail-fast: false
max-parallel: 3
matrix:
branch: [master]
target:
- os: linux
cpu: amd64
nim_branch: devel
- os: windows
cpu: amd64
nim_branch: devel
- os: macos
cpu: amd64
nim_branch: devel
include:
- target:
os: linux
builder: ubuntu-22.04
- target:
os: windows
builder: windows-2022
- target:
os: macos
builder: macos-14
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.target.nim_branch }} (${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
env:
NIM_DIR: nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }}
NIM_BRANCH: ${{ matrix.target.nim_branch }}
NIM_ARCH: ${{ matrix.target.cpu }}
steps:
- name: Checkout Moonbird
uses: actions/checkout@v4
with:
path: Moonbird
submodules: false
- name: Setup Nim
uses: alaviss/[email protected]
with:
path: 'nim'
version: ${{ matrix.target.nim_branch }}
architecture: ${{ matrix.target.cpu }}
- name: Build binary
shell: bash
run: |
cd Moonbird
if [ ${{ runner.os }} = 'macOS' ]; then
nim default Moonbird
else
nim default --passL:"-static" Moonbird
fi
mv bin/Moonbird${{ runner.os == 'Windows' && '.exe' || '' }} bin/Moonbird-${{ github.event.release.tag_name }}-${{ matrix.target.os }}-${{ matrix.target.cpu }}${{ runner.os == 'Windows' && '.exe' || '' }}
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: ./Moonbird/bin/Moonbird-${{ github.event.release.tag_name }}-${{ matrix.target.os }}-${{ matrix.target.cpu }}${{ runner.os == 'Windows' && '.exe' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}