-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (126 loc) · 5.39 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (126 loc) · 5.39 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Releasing ModVerify
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
branch:
description: "The branch to a release to"
required: true
env:
TOOL_PROJ_PATH: ./src/ModVerify.CliApp/ModVerify.CliApp.csproj
PUBLISH_SCRIPT: ./modules/ModdingToolBase/scripts/Publish-Release.ps1
TOOL_EXE: ModVerify.exe
UPDATER_EXE: AnakinRaW.ExternalUpdater.exe
EMBEDDED_TRUST_CERT: src/ModVerify.CliApp/Resources/Certs/AET-root.cer
ORIGIN_BASE: https://republicatwar.com/downloads/ModVerify
SFTP_BASE_PATH: downloads/ModVerify/
BRANCH_NAME: ${{ github.event.inputs.branch || 'stable' }}
# Migration-release values. Leave empty for a normal release; populate to enable.
#
# Origin URL of the next-generation channel, written into the manifest's componentOriginInfo.
NEXT_ORIGIN_BASE: https://republicatwar.com/downloads/ModVerify/v2
# SFTP path the next-generation channel uploads to. Set together with NEXT_ORIGIN_BASE.
NEXT_SFTP_BASE_PATH: downloads/ModVerify/v2/
# Previously-deployed updater used in place of the build-output one for the primary deploy.
# Only the old-gen manifest lists this binary; the next-gen manifest still uses the build-output updater.
# Requires NEXT_ORIGIN_BASE + NEXT_SFTP_BASE_PATH to be set.
COMPAT_UPDATER: tools/v1/AnakinRaW.ExternalUpdater.exe
jobs:
# Builds and tests the solution.
test:
uses: ./.github/workflows/test.yml
# End-to-end self-update test (single-channel + dual-channel via /v2/).
integration-test:
needs: [test]
uses: ./.github/workflows/integration-test.yml
pack:
name: Pack
needs: [test]
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v5
- name: Create NetFramework Release
# use build for .NET Framework to enusre external updatere .EXE is included
run: dotnet build ${{ env.TOOL_PROJ_PATH }} --configuration Release -f net481 --output ./releases/net481 /p:DebugType=None /p:DebugSymbols=false
- name: Create Net Core Release
# use publish for .NET Core
run: dotnet publish ${{ env.TOOL_PROJ_PATH }} --configuration Release -f net10.0 --output ./releases/net10.0 /p:DebugType=None /p:DebugSymbols=false
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: Binary Releases
path: ./releases
if-no-files-found: error
retention-days: 1
deploy:
name: Deploy
# Stable deploys are gated to 'main'. Non-stable channels (beta, canary, etc.) can be
# workflow_dispatched from any branch.
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.branch != 'stable' || github.ref == 'refs/heads/main'))
needs: [pack, integration-test]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- uses: actions/download-artifact@v8
with:
name: Binary Releases
path: ./releases
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Publish self-update release
shell: pwsh
run: |
& $env:PUBLISH_SCRIPT `
-AppExePath "./releases/net481/$env:TOOL_EXE" `
-UpdaterExePath "./releases/net481/$env:UPDATER_EXE" `
-EmbeddedTrustCertPath "$env:EMBEDDED_TRUST_CERT" `
-Origin "$env:ORIGIN_BASE" `
-SftpBasePath "$env:SFTP_BASE_PATH" `
-Branch "$env:BRANCH_NAME" `
-SigningPfxBase64 "${{ secrets.UPDATER_SIGNING_PFX_B64 }}" `
-SigningPfxPassword "${{ secrets.UPDATER_SIGNING_PFX_PASSWORD }}" `
-SftpHost "republicatwar.com" `
-SftpPort 1579 `
-SftpUser "${{ secrets.SFTP_USER }}" `
-SftpPassword "${{ secrets.SFTP_PASSWORD }}" `
-NextOrigin "$env:NEXT_ORIGIN_BASE" `
-NextSftpBasePath "$env:NEXT_SFTP_BASE_PATH" `
-CompatibilityUpdaterExePath "$env:COMPAT_UPDATER"
# Deploy .NET Core and .NET Framework apps to Github
- name: Create NET Core .zip
# Change into the artifacts directory to avoid including the directory itself in the zip archive
working-directory: ./releases/net10.0
run: zip -r ../ModVerify-Net10.zip .
- uses: dotnet/nbgv@v0.5.2
id: nbgv
- name: Create GitHub release
# Create a GitHub release on push to main only
if: |
github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: softprops/action-gh-release@v3
with:
name: v${{ steps.nbgv.outputs.SemVer2 }}
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: |
./releases/net481/ModVerify.exe
./releases/ModVerify-Net10.zip