Compare commits

..

2 Commits

Author SHA1 Message Date
hizumi
72bac32219 create release workflow 2024-02-15 18:40:28 -06:00
hizumi
21dbb725ac sync develop workflow 2024-02-15 18:40:13 -06:00
2 changed files with 107 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ jobs:
echo "repository: ${{ gitea.repository }}"
echo "ref: ${{ gitea.ref }}"
echo "ref_name: ${{ gitea.ref_name }}"
echo "sha: ${{ gitea.sha }}"
echo "api_url: ${{ gitea.api_url }}"
echo "workflow: ${{ gitea.workflow }}"
@@ -43,7 +44,7 @@ jobs:
"Authorization" = "token ${{secrets.RELEASE_TOKEN}}"
}
Invoke-WebRequest -Uri "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/tags/testing-release" -Method Delete -Headers $headers
- name: Delete old testing-release tag
run: |
$headers = @{
@@ -51,7 +52,15 @@ jobs:
"Authorization" = "token ${{secrets.RELEASE_TOKEN}}"
}
Invoke-WebRequest -Uri "${{ gitea.api_url }}/repos/${{ gitea.repository }}/tags/testing-release" -Method Delete -Headers $headers
- name: Create new testing-release tag
run: |
$headers = @{
"accept" = "application/json"
"Authorization" = "token ${{secrets.RELEASE_TOKEN}}"
}
Invoke-WebRequest -Uri "${{ gitea.api_url }}/repos/${{ gitea.repository }}/tags" -Method Post -Headers $headers -ContentType "application/json" -Body "{`"message`": `"testing-release`", `"tag_name`": `"testing-release`", `"target`": `"${{ gitea.sha }}`"}"
- name: Create new testing-release
uses: https://gitea.com/actions/gitea-release-action@v1.1.6
with:

View File

@@ -0,0 +1,96 @@
name: Pack ZGM mission PBO files
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
release:
branches: [main]
jobs:
GetMissionList:
runs-on: windows
steps:
- name: Checkout missions
uses: actions/checkout@v3
with:
repository: 17th-Ranger-Battalion-ORG/MissionsForZGM
fetch-depth: 0
ref: 'main'
token: ${{ secrets.READ_TOKEN }}
path: template
- name: Get mission list
run: |
Get-ChildItem missions/*
- name: Current Directory
run: |
Get-Location
CreatePboFiles:
runs-on: windows
steps:
- name: Checkout template
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: 'main'
token: ${{ secrets.READ_TOKEN }}
path: template
- name: Prepare template
run: |
Remove-Item -Recurse template\aaFrameworkUtils
Remove-Item -Recurse template\framework\x
Remove-Item -Recurse template\.git*
- name: Checkout missions
uses: actions/checkout@v3
with:
repository: 17th-Ranger-Battalion-ORG/MissionsForZGM
fetch-depth: 0
ref: 'main'
token: ${{ secrets.READ_TOKEN }}
path: zgm-files
- name: Prepare tools
run: mkdir packed-files
- name: Pack PBOs
run: |
$date = Get-Date -Format "yyyy-MM-dd"
foreach ($file in Get-ChildItem missions) {
$map = (Get-Item zgm-files\missions\$file).Basename.split('\.')[-1]
Copy-Item zgm-files\missions\$file\mission.sqm template\
(Get-Content .\template\mission_settings.hpp).Replace("MISSION AUTHOR","17th Ranger Battalion") | Set-Content .\template\mission_settings.hpp
(Get-Content .\template\mission_settings.hpp).Replace("THIS APPEARS ON TOP OF THE LOADING SCREEN IMAGE","GAME MASTER") | Set-Content .\template\mission_settings.hpp
(Get-Content .\template\mission_settings.hpp).Replace("THIS APPEARS BELOW THE LOADING SCREEN IMAGE","Forcing you to respawn since 2013") | Set-Content .\template\mission_settings.hpp
(Get-Content .\template\mission_settings.hpp).Replace("THIS IS THE NAME ON THE #MISSIONS LIST","BASE ZGM $date") | Set-Content .\template\mission_settings.hpp
(Get-Content .\template\mission_settings.hpp).Replace("THIS IS WHERE YOU DESCRIBE THE MISSION IN THE #MISSION LIST","I have 2 headless clients, and am most likely an airfield spawn") | Set-Content .\template\mission_settings.hpp
(Get-Content .\template\mission_settings.hpp).Replace("MY SERIES NAME","ZEUS GAME MASTER") | Set-Content .\template\mission_settings.hpp
$missionName = Get-Content .\template\mission.sqm | Select-String -Pattern 'sourceName="(.*)";'
$missionName = $missionName.Matches.groups[1].value
(Get-Content .\template\mission.sqm).Replace($missionName,"FRAMEWORK ZGM $date") | Set-Content .\template\mission.sqm
zgm-files\tools\PBOconsole.exe -pack template packed-files\mission.$map.pbo
}
- name: List PBOs
run: |
cd packed-files
Get-ChildItem
- name: Backup artifacts from runner
uses: actions/upload-artifact@v3
with:
name: zgm-pbo-files
path: packed-files/*
- name: Create release
uses: https://gitea.com/actions/gitea-release-action@v1.1.6
with:
tag_name: 'snapshot-release'
release_name: 'snapshot-release'
files: |-
packed-files/**
api_key: '${{secrets.RELEASE_TOKEN}}'