Automated GCM Archive Build (#9)

* Set up CI with Azure Pipelines
This commit is contained in:
Matteias Collet 2019-04-18 03:43:26 +02:00 committed by GitHub
parent 0cfc103f07
commit 78e50f20bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 0 deletions

68
azure-pipelines.yml Normal file
View file

@ -0,0 +1,68 @@
trigger:
branches:
include:
- master
pool:
vmImage: 'win1803'
steps:
- task: PowerShell@2
displayName: 'Create GCM Archive'
inputs:
targetType: 'inline'
script: '$ErrorActionPreference = "Stop";
New-Item -ItemType directory -Path "./gcmbuild";
Copy-Item "./codes/GMSE01.xml" "./gcmbuild/GMSE01.xml";
Copy-Item "./codes/GMSE01.xml" "./gcmbuild/GMSP01.xml";
Copy-Item "./codes/GMSE01.xml" "./gcmbuild/GMSJ01.xml";
Copy-Item "./codes/GMSE01.xml" "./gcmbuild/GMSJ0A.xml";
cd "./gcmbuild";
function XmlToGcm($source, $destination, $versionname) {
[xml]$xml = Get-Content $source;
Add-Content $destination $versionname;
Add-Content $destination "Super Mario Sunshine" -NoNewline;
foreach($code in $xml.codes.code) {
Add-Content $destination "";
Add-Content $destination "";
Add-Content $destination "$($code.title."#text") ($($code.date)) [$($code.author)]";
$codeSource = $code.source -replace " +$", "" -replace "^? [^a-zA-Z0-9]", "";
Add-Content $destination $codeSource.Trim() -NoNewline;
};
};
XmlToGcm "GMSE01.xml" "GMSE01.txt" "GMSE01";
XmlToGcm "GMSP01.xml" "GMSP01.txt" "GMSP01";
XmlToGcm "GMSJ01.xml" "GMSJ01.txt" "GMSJ01";
XmlToGcm "GMSJ0A.xml" "GMSJ01 (A).txt" "GMSJ01";
Compress-Archive "./*.txt" "../files/GCMCodes.zip" -Force;
cd ..;
Remove-Item "./gcmbuild" -Recurse;'
failOnStderr: true
workingDirectory: '.'
- task: PowerShell@2
displayName: 'Commit Changes'
inputs:
targetType: 'inline'
script: '$ErrorActionPreference = "Stop";
git config --local user.name "Matteias Collet";
git config --local user.email "matteias.collet@bluewin.ch";
git add ./files/GCMCodes.zip;
git commit -m "Update GCM Archive [skip ci]";'
failOnStderr: true
workingDirectory: '.'
- task: PowerShell@2
displayName: 'Push Changes'
env:
GitHub_PAT: $(GitHub_PAT)
inputs:
targetType: 'inline'
script: '$ErrorActionPreference = "Stop";
git push -q $(GitHub_PAT) HEAD:master;'
failOnStderr: true
workingDirectory: '.'

Binary file not shown.