Skip to content

Commit e63a1ff

Browse files
committed
Add Game Version to Release Name
1 parent 8c5d683 commit e63a1ff

3 files changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/Build Mod on PR.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: windows-latest
2626

2727
steps:
28-
- name: Checkout code
28+
- name: Checkout
2929
uses: actions/checkout@v4
3030
with:
3131
ref: "${{ github.event.pull_request.head.sha }}"
@@ -51,13 +51,12 @@ jobs:
5151
- name: Find subdirectory
5252
id: find-dir
5353
run: |
54-
$currentPath = "${{ github.workspace }}"
55-
$prefixPath = Join-Path -Path $currentPath -ChildPath 'GameFiles'
56-
$subdirectory = Get-ChildItem -Path $prefixPath -Directory | Select-Object -First 1 -ExpandProperty Name
57-
$fullPath = Join-Path -Path $prefixPath -ChildPath $subdirectory
58-
$currentDirName = Split-Path -Path $currentPath -Leaf
59-
echo "currentDirName=$currentDirName" >> $env:GITHUB_ENV
60-
echo "fullPath=$fullPath" >> $env:GITHUB_ENV
54+
$prefixPath = "${{ github.workspace }}"
55+
$zipFileObject = Get-ChildItem -Recurse -Path $prefixPath -Filter "*.zip" | Select-Object -First 1
56+
$zipFile = $zipFileObject.BaseName
57+
$zipFilePath = (Get-Item $zipFileObject.FullName).Directory.FullName
58+
echo "zipFile=$zipFile" >> $env:GITHUB_ENV
59+
echo "zipFilePath=$zipFilePath" >> $env:GITHUB_ENV
6160
shell: pwsh
6261

6362
- name: Build Project
@@ -66,8 +65,8 @@ jobs:
6665
- name: Find zip file
6766
id: find-zip
6867
run: |
69-
$prefixPath = "${{ github.workspace }}\${{ env.currentDirName }}\Out"
70-
$zipFile = Get-ChildItem -Path $prefixPath -Recurse -Filter "*.zip" | Select-Object -First 1 -ExpandProperty BaseName
68+
$prefixPath = "${{ github.workspace }}"
69+
$zipFile = Get-ChildItem -Path $prefixPath -Recurse -Filter "Out\*.zip" | Select-Object -First 1 -ExpandProperty BaseName
7170
echo "zipFile=$zipFile" >> $env:GITHUB_ENV
7271
shell: pwsh
7372

.github/workflows/Build Mod on Push.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ jobs:
6363
- name: Find zip file
6464
id: find-zip
6565
run: |
66-
$prefixPath = "${{ github.workspace }}\${{ env.currentDirName }}\Out"
67-
$zipFile = Get-ChildItem -Path $prefixPath -Recurse -Filter "*.zip" | Select-Object -First 1 -ExpandProperty BaseName
66+
$prefixPath = "${{ github.workspace }}"
67+
$zipFileObject = Get-ChildItem -Recurse -Path $prefixPath -Filter "*.zip" | Select-Object -First 1
68+
$zipFile = $zipFileObject.BaseName
69+
$zipFilePath = (Get-Item $zipFileObject.FullName).Directory.FullName
6870
echo "zipFile=$zipFile" >> $env:GITHUB_ENV
71+
echo "zipFilePath=$zipFilePath" >> $env:GITHUB_ENV
6972
shell: pwsh
7073

7174
- name: Upload build artifacts

.github/workflows/Create Release for new Tag.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ jobs:
5555
$currentPath = "${{ github.workspace }}"
5656
$prefixPath = Join-Path -Path $currentPath -ChildPath 'GameFiles'
5757
$subdirectory = Get-ChildItem -Path $prefixPath -Directory | Select-Object -First 1 -ExpandProperty Name
58+
$version = [regex]::Match($subdirectory, '(?<=\d+\.\d+\.\d+-).+$').Value
5859
$fullPath = Join-Path -Path $prefixPath -ChildPath $subdirectory
5960
$currentDirName = Split-Path -Path $currentPath -Leaf
6061
echo "currentDirName=$currentDirName" >> $env:GITHUB_ENV
6162
echo "fullPath=$fullPath" >> $env:GITHUB_ENV
63+
echo "GameVersion=$version" >> $env:GITHUB_ENV
6264
shell: pwsh
6365

6466
- name: Build Project
@@ -67,18 +69,22 @@ jobs:
6769
- name: Find zip file
6870
id: find-zip
6971
run: |
70-
$prefixPath = "${{ github.workspace }}\${{ env.currentDirName }}\Out"
71-
$zipFile = Get-ChildItem -Path $prefixPath -Recurse -Filter "*.zip" | Select-Object -First 1 -ExpandProperty BaseName
72+
$prefixPath = "${{ github.workspace }}"
73+
$zipFileObject = Get-ChildItem -Recurse -Path $prefixPath -Filter "*.zip" | Select-Object -First 1
74+
$zipFile = $zipFileObject.BaseName
75+
$zipFilePath = (Get-Item $zipFileObject.FullName).Directory.FullName
7276
echo "zipFile=$zipFile" >> $env:GITHUB_ENV
77+
echo "zipFilePath=$zipFilePath" >> $env:GITHUB_ENV
7378
shell: pwsh
7479

7580
- name: Upload build artifacts
7681
uses: actions/upload-artifact@v4
7782
with:
7883
name: ${{ env.zipFile }}
79-
path: ${{ github.workspace }}\${{ env.currentDirName }}\Out\Bin
84+
path: ${{ env.zipFilePath }}\Bin
8085

8186
- name: Create Release
8287
uses: ncipollo/release-action@v1
8388
with:
84-
artifacts: ${{ github.workspace }}\${{ env.currentDirName }}\Out\*.zip
89+
artifacts: ${{ env.zipFilePath }}\*.zip
90+
name: ${{ env.ZipFile }} built for Game Version ${{ env.GameVersion }}

0 commit comments

Comments
 (0)