Skip to content

Merge branch 'master' of https://github.com/X-Hax/SA-Mod-Manager #210

Merge branch 'master' of https://github.com/X-Hax/SA-Mod-Manager

Merge branch 'master' of https://github.com/X-Hax/SA-Mod-Manager #210

Workflow file for this run

name: Windows Build and Publish
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
env:
# Path to the WPF project file relative to the root of the project.
WPF_PROJECT_FILE: ./SA-Mod-Manager/SAModManager.csproj
PUBLISH_PATH: ./source/Publish
PUBLISH_CHANGELOG_PATH: ./source/Publish/Changelog.md
RELEASE_TAG: ${{ github.ref_name }}
jobs:
build:
name: ${{matrix.configuration}}
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: Add Git hash to resources
working-directory: ${{env.GITHUB_WORKSPACE}}
run: echo ${{github.sha}} > SA-Mod-Manager/Resources/Version.txt
- name: Setup AutoChangelog
run: npm install -g auto-changelog
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Publish 64-bit WPF application
working-directory: ${{env.GITHUB_WORKSPACE}}
run: dotnet publish -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
- name: CleanUp Misc Files (64-bit)
working-directory: ${{github.workspace}}\bin\Release\net7.0-windows\win-x64\publish
run: del SAModManager.dll.config, SAModManager.pdb
- name: Publish 32-bit WPF application
working-directory: ${{env.GITHUB_WORKSPACE}}
run: dotnet publish -p:PublishSingleFile=true -r win-x86 -c Release --self-contained false
- name: CleanUp Misc Files (32-bit)
working-directory: ${{github.workspace}}\bin\Release\net7.0-windows\win-x86\publish
run: del SAModManager.dll.config, SAModManager.pdb
- name: Create Changelog (on Tag)
run: |
[System.IO.Directory]::CreateDirectory("$env:PUBLISH_PATH")
auto-changelog --sort-commits date --hide-credit --template changelog-template.hbs --commit-limit 30 --starting-version "$env:RELEASE_TAG" --output "$env:PUBLISH_CHANGELOG_PATH"
- name: Archive 64-bit
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'release_x64.zip'
directory: bin/Release/net7.0-windows/win-x64/publish
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Archive 32-bit
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'release_x86.zip'
directory: bin/Release/net7.0-windows/win-x86/publish
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Create Release
uses: softprops/[email protected]
with:
body_path: ${{ env.PUBLISH_CHANGELOG_PATH }}
files: |
bin/Release/net7.0-windows/win-x64/publish/*.zip
bin/Release/net7.0-windows/win-x86/publish/*.zip
token: ${{ secrets.GITHUB_TOKEN }}