Skip to content

update github actions workflow #116

update github actions workflow

update github actions workflow #116

Workflow file for this run

name: "Build and publish"
on:
push:
tags:
- 'v*'
env:
INSTALLER_PATH: 'Totoro.Installer/Totoro.Installer.wixproj'
MAIN_PROJECT_PATH: 'Totoro.WinUI/Totoro.WinUI.csproj'
FFMPEG_PATH: 'Totoro.Installer/FFmpeg'
PUBLISH_FOLDER: 'Totoro.WinUI/bin/publish'
jobs:
deploy:
name: 'Build and deploy'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Install dotnet'
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0'
- name: 'Add msbuild to PATH'
uses: microsoft/[email protected]
- name: 'Get version'
id: version
uses: battila7/get-version-action@v2
- name: 'Build Project'
run: dotnet publish ${{ env.MAIN_PROJECT_PATH }} --self-contained -c Release -r win10-x64 -o ..\Totoro.WinUI\bin\publish\ /property:BuildVersion=${{ steps.version.outputs.version-without-v }}
- name: 'Copy FFMPEG'
run: xcopy ${{ env.FFMPEG_PATH }} ${{ env.PUBLISH_FOLDER }}/FFmpeg/ /s /e /h"
- name: 'Remove Trash'
run: rd /q /s Totoro.WinUI\bin\publish\gd-gb Totoro.WinUI\bin\publish\mi-NZ Totoro.WinUI\bin\publish\ug-CN
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: '${{ env.PUBLISH_FOLDER }}/appsettings.json'
env:
ClientId: ${{ secrets.MAL_CLIENT_ID }}
ClientIdAniList: ${{ secrets.ANILIST_CLIENT_ID }}
ClientIdSimkl: ${{ secrets.SIMKL_CLIENT_ID }}
- name: 'Build MSI'
run: msbuild ${{ env.INSTALLER_PATH }} /property:Configuration=Release /property:BuildVersion=${{ steps.version.outputs.version-without-v }}
- name: 'Create release'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version-without-v }}
release_name: ${{ steps.version.outputs.version-without-v }}
- name: 'Add MSI to release'
uses: csexton/release-asset-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pattern: Totoro.Installer/bin/Release/en-us/Totoro-Release.msi
release-url: ${{ steps.create_release.outputs.upload_url }}