-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for hosting multiple recent dev builds
In case an overzealous change breaks something, people won't have to use an ancient stable version while they wait for me to fix things. [skip ci]
- Loading branch information
1 parent
3c6e1f9
commit b679bcc
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,13 +156,47 @@ jobs: | |
with: | ||
name: zip | ||
|
||
- name: Rename current release | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
shell: pwsh | ||
run: | | ||
$oldName = Get-Item -Path '*.zip' | ||
$newName = $oldName.Name -replace '(.*?)-(.*)', '$1-dev-newest-$2' | ||
Rename-Item -Path $oldName -NewName $newName | ||
- name: Download old releases | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
shell: pwsh | ||
run: gh release download latest --dir old_releases | ||
|
||
- name: Prep old releases | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
shell: pwsh | ||
working-directory: old_releases | ||
run: | | ||
Remove-Item -Path *oldest* | ||
if (Test-Path *older*) | ||
{ | ||
$oldName = Get-Item -Path *older* | ||
$newName = $oldName.Name -replace 'older', 'oldest' | ||
Rename-Item -Path $oldName -NewName $newName | ||
} | ||
if (Test-Path *newest*) | ||
{ | ||
$oldName = Get-Item -Path *newest* | ||
$newName = $oldName.Name -replace 'newest', 'older' | ||
Rename-Item -Path $oldName -NewName $newName | ||
} | ||
Move-Item -Path *.zip -Destination .. | ||
- name: Release latest dev build | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
uses: crowbarmaster/[email protected] | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: 'latest' | ||
title: 'Latest dev build' | ||
body: "This rolling window release offers the 3 most recent development builds of SHME. Try 'newest' first, then 'older' or 'oldest' if something's broken. Have fun!" | ||
prerelease: false | ||
generate_notes: true | ||
files: | | ||
|