Skip to content

Commit 9bf2549

Browse files
committed
prepare manual release in CI/CD
1 parent 59b5a3f commit 9bf2549

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8+
workflow_dispatch:
9+
inputs:
10+
branch:
11+
description: "The branch to a release to"
12+
required: true
13+
14+
env:
15+
TOOL_PROJ_PATH: ./src/ModVerify.CliApp/ModVerify.CliApp.csproj
16+
CREATOR_PROJ_PATH: ./Modules/ModdingToolBase/src/AnakinApps/ApplicationManifestCreator/ApplicationManifestCreator.csproj
17+
UPLOADER_PROJ_PATH: ./Modules/ModdingToolBase/src/AnakinApps/FtpUploader/FtpUploader.csproj
18+
TOOL_EXE: ModVerify.exe
19+
UPDATER_EXE: AnakinRaW.ExternalUpdater.exe
20+
MANIFEST_CREATOR: AnakinRaW.ApplicationManifestCreator.dll
21+
SFTP_UPLOADER: AnakinRaW.FtpUploader.dll
22+
ORIGIN_BASE: https://republicatwar.com/downloads/ModVerify
23+
ORIGIN_BASE_PART: downloads/ModVerify/
24+
BRANCH_NAME: ${{ github.event.inputs.branch || 'stable' }}
825

926
jobs:
1027

@@ -25,9 +42,9 @@ jobs:
2542
- name: Setup .NET
2643
uses: actions/setup-dotnet@v4
2744
- name: Create NetFramework Release
28-
run: dotnet publish .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net48 --output ./releases/net48 /p:DebugType=None /p:DebugSymbols=false
45+
run: dotnet publish ${{ env.TOOL_PROJ_PATH }} --configuration Release -f net48 --output ./releases/net48 /p:DebugType=None /p:DebugSymbols=false
2946
- name: Create Net Core Release
30-
run: dotnet publish .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net9.0 --output ./releases/net9.0 /p:DebugType=None /p:DebugSymbols=false
47+
run: dotnet publish ${{ env.TOOL_PROJ_PATH }} --configuration Release -f net9.0 --output ./releases/net9.0 /p:DebugType=None /p:DebugSymbols=false
3148
- name: Upload a Build Artifact
3249
uses: actions/upload-artifact@v4
3350
with:
@@ -38,8 +55,9 @@ jobs:
3855

3956
deploy:
4057
name: Deploy
58+
# Deploy on push to main or manual trigger
4159
if: |
42-
github.ref == 'refs/heads/main' && github.event_name == 'push'
60+
(github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'workflow_dispatch'
4361
needs: [pack]
4462
runs-on: ubuntu-latest
4563
steps:
@@ -58,6 +76,9 @@ jobs:
5876
- uses: dotnet/nbgv@v0.4.2
5977
id: nbgv
6078
- name: Create GitHub release
79+
# Create a GitHub release on push to main only
80+
if: |
81+
github.ref == 'refs/heads/main' && github.event_name == 'push'
6182
uses: softprops/action-gh-release@v2
6283
with:
6384
name: v${{ steps.nbgv.outputs.SemVer2 }}

0 commit comments

Comments
 (0)