Skip to content

CN2.9.0

CN2.9.0 #147

Workflow file for this run

name: Standalone
on:
release:
types:
- published
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
jobs:
build:
strategy:
matrix:
target: [{"runtime": 'ubuntu-x64', "artifact": "QuestPatcher-ubuntu.zip"}, {"runtime": 'win-x64', "artifact": "QuestPatcher-windows-standalone.zip"}]
runs-on: windows-latest
name: Build for ${{ matrix.target.runtime }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.402
- name: Install dependencies
run: dotnet restore
- name: Set version
if: ${{ github.event_name == 'release' }}
run: '"${{ github.event.release.tag_name }}" | Out-File -NoNewline -FilePath ./VERSION'
- name: Build ${{ matrix.target.runtime }}
run: dotnet publish QuestPatcher/QuestPatcher.csproj -r ${{ matrix.target.runtime }} -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -c Release --self-contained
- name: Copy license
run: cp LICENSE QuestPatcher/bin/Release/net6.0/${{ matrix.target.runtime }}/publish/LICENSE.txt
- name: Artifact Upload ${{ matrix.target.runtime }}
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target.runtime }}
path: QuestPatcher/bin/Release/net6.0/${{ matrix.target.runtime }}/publish/
- name: Compress Release Artifact
if: ${{ github.event_name == 'release' }}
run: 'Compress-Archive QuestPatcher/bin/Release/net6.0/${{ matrix.target.runtime }}/publish/* ./release.zip'
- name: Upload Release Asset
if: ${{ github.event_name == 'release' }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./release.zip
asset_name: ${{ matrix.target.artifact }}
asset_content_type: application/zip