-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (58 loc) · 2.66 KB
/
Deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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/setup-msbuild@v1.1
- 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 ${{ env.PUBLISH_FOLDER }}\ /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 ${{ env.PUBLISH_FOLDER }}\gd-gb\*, ${{ env.PUBLISH_FOLDER }}\mi-NZ\*, ${{ env.PUBLISH_FOLDER }}\ug-CN\*
- name: Update App Settings
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 }}
SimklSecret: ${{ secrets.SIMKL_SECRET }}
ClientIdDiscord: ${{ secrets.DISCORD_CLIENT_ID }}
- name: 'Build Installer'
run: msbuild ${{ env.INSTALLER_PATH }} /property:Configuration=Release /property:BuildVersion=${{ steps.version.outputs.version-without-v }} /property:BasePath=${{ env.PUBLISH_FOLDER }}
- 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 }}