Skip to content

Fix syntax errors in issue #34 #58

Fix syntax errors in issue #34

Fix syntax errors in issue #34 #58

Workflow file for this run

name: Release Nwnsc Binaries
on:
pull_request:
push:
release:
types: published
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
zip_name: nwnsc-linux
- os: macos-latest
zip_name: nwnsc-mac
- os: windows-latest
zip_name: nwnsc-win
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up repository and variables
run: |
git fetch --prune --unshallow --tags -f
echo "NWNSC_VERSION=`git describe --tags --dirty=-dirty --always`" >> $GITHUB_ENV
shell: bash
# Install OS specific dependencies
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install bison
- name: Install macos dependencies
if: matrix.os == 'macos-latest'
run: brew install bison cmake p7zip
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: choco install winflexbison
- name: Build nwnsc
env:
CFLAGS/CXXFLAGS: -g -O2 -fvisibility=hidden
shell: bash
run: |
cmake .
cmake --build . --config Release
- name: Create nwnsc archive
shell: bash
env:
ZIP_NAME: ${{ matrix.zip_name }}
run: |
mkdir artifact
7z a artifact/${ZIP_NAME}-${NWNSC_VERSION}.zip $(find ./nwnsc -name nwnsc -type f -or -name nwnsc.exe -type f)
# Upload nwnsc binary archive as an artifact
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: nwnsc-binary-archives
path: artifact
- name: Upload release asset
if: github.event.action == 'published'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./artifact/${{ matrix.zip_name }}-${{ env.NWNSC_VERSION }}.zip
asset_name: ${{ matrix.zip_name }}-${{ env.NWNSC_VERSION }}.zip
asset_content_type: application/zip