update workflows with new formatting and urls

This commit is contained in:
hizumi
2024-02-22 23:12:27 -06:00
parent 2a776718c0
commit 77c3b0d67a
3 changed files with 69 additions and 125 deletions

View File

@@ -62,7 +62,7 @@ jobs:
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
uses: https://gitea.com/actions/gitea-release-action@v1.3.0
with:
tag_name: 'testing-release'
name: 'testing-release'

View File

@@ -0,0 +1,68 @@
name: Pack Release files
on:
release:
types: [published]
jobs:
DispatchZGMBuild:
name: Dispatch MissionZGM build job
runs-on: windows
steps:
- name: Diagnostics
run: |
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 }}"
- name: Publish remote issue
run: |
$headers = @{
"accept" = "application/json"
"Authorization" = "token ${{ secrets.RUNNER_ISSUE_TOKEN }}"
}
$response = Invoke-RestMethod -Uri "${{ gitea.api_url }}/repos17th-Ranger-Battalion-ORG/MissionsForZGM/issues" -Method Post -Headers $headers -ContentType "application/json" -Body "{`"title`": `"publish-release`"}"
CreateRelease:
name: Publish cleaned template
runs-on: windows
steps:
- name: Diagnostics
run: |
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 }}"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: 'main'
path: release
- name: Prepare template
run: |
mkdir MissionTemplate
cd MissionTemplate
Get-ChildItem ..\release\ | Copy-Item -Recurse
Remove-Item -Recurse aaFrameworkUtils
Remove-Item -Recurse framework\x
Remove-Item -Recurse .git*
Get-ChildItem
- name: Create archive
run: |
$revision = git rev-parse --short=10 HEAD
cd MissionTemplate
$tag = git describe --abbrev=0 --tags
Compress-Archive MissionFramework mission-maker-template-v$tag-$revision.zip
- name: Add archive to release
uses: https://gitea.com/actions/gitea-release-action@v1.3.0
with:
files: |-
mission-maker-template*.zip

View File

@@ -1,124 +0,0 @@
name: Pack ZGM mission PBO files
on:
push:
branches: [main]
jobs:
GetMissionList:
name: Get ZGM mission list
runs-on: windows
steps:
- name: Diagnostics
run: |
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 }}"
- name: Checkout missions
uses: actions/checkout@v3
with:
repository: 17th-Ranger-Battalion-ORG/MissionsForZGM
fetch-depth: 0
ref: 'main'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Get current directory list
run: |
Get-ChildItem
- name: Get mission list
run: |
Get-ChildItem MissionsForZGM/*
CreatePboFiles:
name: Create PBO files
runs-on: windows
steps:
- name: Diagnostics
run: |
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 }}"
- name: Checkout template
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: 'main'
token: ${{ secrets.RELEASE_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.RELEASE_TOKEN }}
path: zgm-files
- name: Get mission list
run: |
Get-ChildItem
- name: Get mission list
run: |
Get-ChildItem zgm-files
- name: Prepare tools
run: |
mkdir packed-files
Remove-Item -Recurse template\.git
- name: Pack PBOs
run: |
$date = Get-Date -Format "yyyy-MM-dd"
foreach ($file in Get-ChildItem zgm-files\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\BASE_ZGM_$date.$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}}'