Skip to content

Commit

Permalink
Fully automate release creation
Browse files Browse the repository at this point in the history
  • Loading branch information
FLSoz committed Aug 22, 2022
1 parent 4a74121 commit 0de9abc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions publish-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
git fetch;
if ($?) { git push };
if ($?) { git push origin v$(node --eval "process.stdout.write(require('./package.json').version)") };
if ($?) { npm run publish };
if ($?) {
$VERSION=$(node --eval "process.stdout.write(require('./package.json').version)")
$API_JSON="{`"tag_name`":`"v$VERSION`",`"target_commitish`":`"main`",`"name`":`"v$VERSION`",`"body`":`"Release of version $VERSION`",`"draft`":true,`"prerelease`":false}"
# ,`"discussion_category_name`":`"Announcements`"
$Headers=@{
'Accept' = 'application/vnd.github+json';
'Authorization' = "token $Env:GH_TOKEN"
}
git push origin v$VERSION
Invoke-WebRequest -UseBasicParsing -Body "$API_JSON" -Method 'POST' -Headers $Headers -Uri "https://api.github.com/repos/FLSoz/terratech-steam-mod-loader/releases"
};
if ($?) { npm run publish };

0 comments on commit 0de9abc

Please sign in to comment.