Repository navigation
134 lines (119 loc) · 4.68 KB
/
Copy pathrelease.yml
File metadata and controls
134 lines (119 loc) · 4.68 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
name: Build and Release
on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0, v2.0.0, etc.
workflow_dispatch: # Allows manual trigger from GitHub UI
inputs:
version:
description: 'Version tag (e.g., v3.0.0)'
required: true
type: string
permissions:
contents: write # Required for creating releases
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Get version from tag
id: get_version
shell: bash
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
# Suffix for built executable filenames. VERSION is already "v"-prefixed (tag form).
echo "suffix=$VERSION" >> $GITHUB_OUTPUT
- name: Restore dependencies
run: dotnet restore "Call of Duty FastFile Editor.sln"
- name: Build and Publish Main Editor
run: |
dotnet publish "Call of Duty FastFile Editor/Call of Duty FastFile Editor.csproj" `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./publish
- name: Build and Publish FastFile Compiler GUI
run: |
dotnet publish "FastFileCompilerGUI/FastFileCompilerGUI.csproj" `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./publish-compiler
- name: Build and Publish FastFile Extractor
run: |
dotnet publish "FastFileExtractor/FastFileExtractor.csproj" `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./publish-extractor
- name: Build and Publish FastFile Converter GUI
run: |
dotnet publish "FastFileConverterGUI/FastFileConverterGUI.csproj" `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./publish-converter
- name: Build and Publish FastFile CLI
run: |
dotnet publish "FastFileCLI/FastFileCLI.csproj" `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./publish-cli
- name: Rename executables with version suffix
shell: pwsh
run: |
$s = "${{ steps.get_version.outputs.suffix }}"
Move-Item "./publish/Call of Duty FastFile Editor.exe" "./publish/Call of Duty FastFile Editor-$s.exe"
Move-Item "./publish-compiler/FastFileCompilerGUI.exe" "./publish-compiler/FastFileCompilerGUI-$s.exe"
Move-Item "./publish-extractor/FastFileExtractor.exe" "./publish-extractor/FastFileExtractor-$s.exe"
Move-Item "./publish-converter/FastFileConverter.exe" "./publish-converter/FastFileConverter-$s.exe"
Move-Item "./publish-cli/ffcli.exe" "./publish-cli/ffcli-$s.exe"
- name: List published files
run: |
Write-Host "Main Editor:"
Get-ChildItem -Path ./publish -Recurse
Write-Host "Compiler GUI:"
Get-ChildItem -Path ./publish-compiler -Recurse
Write-Host "Extractor:"
Get-ChildItem -Path ./publish-extractor -Recurse
Write-Host "Converter GUI:"
Get-ChildItem -Path ./publish-converter -Recurse
Write-Host "CLI:"
Get-ChildItem -Path ./publish-cli -Recurse
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
files: |
./publish/Call of Duty FastFile Editor-${{ steps.get_version.outputs.suffix }}.exe
./publish-compiler/FastFileCompilerGUI-${{ steps.get_version.outputs.suffix }}.exe
./publish-extractor/FastFileExtractor-${{ steps.get_version.outputs.suffix }}.exe
./publish-converter/FastFileConverter-${{ steps.get_version.outputs.suffix }}.exe
./publish-cli/ffcli-${{ steps.get_version.outputs.suffix }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}