1 game name #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build new version | |
on: | |
pull_request: | |
types: | |
- closed | |
workflow_dispatch: | |
inputs: | |
draft_release: | |
type: boolean | |
description: 'Create draft release' | |
required: false | |
default: false | |
no_publish: | |
type: boolean | |
description: 'Don''t publish (no release)' | |
required: false | |
default: false | |
jobs: | |
build: | |
if: ((github.event.pull_request.merged == true) || (github.event_name == 'workflow_dispatch')) | |
runs-on: windows-latest | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
show-progress: false | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build version | |
run: dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true --self-contained false | |
- name: Get version | |
id: get_version | |
run: echo "version=$((Select-Xml -Path .\$( $env:PROJECT_NAME )\$( $env:PROJECT_NAME ).csproj -XPath '/Project/PropertyGroup/AssemblyVersion').Node.InnerXML)" >> $env:GITHUB_OUTPUT | |
shell: pwsh | |
- name: Create artifact | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: AssM_${{ steps.get_version.outputs.version }}.zip | |
path: bin/Release/net8.0/win-x64/publish/ | |
exclusions: '*.pdb Avalonia.Labs.Gif.xml' | |
- name: Create tag | |
run: | | |
git tag v${{ steps.get_version.outputs.version }} | |
git push --tags | |
- name: Create changelog text | |
id: changelog | |
uses: loopwerk/tag-changelog@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Draft Release | |
id: create_draft_release | |
uses: ncipollo/release-action@v1 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.draft_release && !inputs.no_publish }} | |
with: | |
artifacts: AssM_${{ steps.get_version.outputs.version }}.zip | |
name: AssM Release v${{ steps.get_version.outputs.version }} | |
tag: v${{ steps.get_version.outputs.version }}_pre | |
commit: master | |
prerelease: true | |
draft: true | |
body: | | |
${{ steps.changelog.outputs.changes }} | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
if: ${{ !inputs.draft_release && !inputs.no_publish }} | |
with: | |
artifacts: AssM_${{ steps.get_version.outputs.version }}.zip | |
name: AssM Release v${{ steps.get_version.outputs.version }} | |
tag: v${{ steps.get_version.outputs.version }} | |
commit: master | |
prerelease: false | |
draft: false | |
body: | | |
${{ steps.changelog.outputs.changes }} |