Skip to content

Commit

Permalink
Allow for hosting multiple recent dev builds
Browse files Browse the repository at this point in the history
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
ItEndsWithTens authored Jun 14, 2024
1 parent 3c6e1f9 commit b679bcc
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit b679bcc

Please sign in to comment.