Skip to content

Commit

Permalink
Add parametrized release script
Browse files Browse the repository at this point in the history
(cherry picked from commit 01284fa)
  • Loading branch information
madebr committed Dec 13, 2024
1 parent 3728217 commit f960613
Show file tree
Hide file tree
Showing 16 changed files with 2,368 additions and 12 deletions.
62 changes: 62 additions & 0 deletions .github/actions/setup-ninja/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Setup ninja'
description: 'Download ninja and add it to the PATH environment variable'
inputs:
version:
description: 'Ninja version'
default: '1.12.1'
runs:
using: 'composite'
steps:
- name: 'Calculate variables'
id: calc
shell: sh
run: |
case "${{ runner.os }}-${{ runner.arch }}" in
"Linux-X86" | "Linux-X64")
archive="ninja-linux.zip"
;;
"Linux-ARM64")
archive="ninja-linux-aarch64.zip"
;;
"macOS-X86" | "macOS-X64" | "macOS-ARM64")
archive="ninja-mac.zip"
;;
"Windows-X86" | "Windows-X64")
archive="ninja-win.zip"
;;
"Windows-ARM64")
archive="ninja-winarm64.zip"
;;
*)
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
exit 1;
;;
esac
echo "archive=${archive}" >> ${GITHUB_OUTPUT}
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore
uses: actions/cache/restore@v4
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})'
if: ${{ (!steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false') }}
shell: pwsh
run: |
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Cache ${{ steps.calc.outputs.archive }}'
if: ${{ (!steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false') }}
uses: actions/cache/save@v4
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Extract ninja'
shell: pwsh
run: |
7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Set output variables'
id: final
shell: pwsh
run: |
echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH
Loading

8 comments on commit f960613

@sezero
Copy link
Contributor

@sezero sezero commented on f960613 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.gitmodules has wrong branch names after this

@sezero
Copy link
Contributor

@sezero sezero commented on f960613 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, pushed 0c5aaf3 to fix that

@madebr
Copy link
Contributor Author

@madebr madebr commented on f960613 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keeping an eye on me :)

@sezero
Copy link
Contributor

@sezero sezero commented on f960613 Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's OK. But, why are we poking the old release branch? @slouken : A new release should be made from the SDL2 branch, as should be the case for all other satellite libs.

@slouken
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because SDL_image will be a point release, not a minor version bump.

@sezero
Copy link
Contributor

@sezero sezero commented on f960613 Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because SDL_image will be a point release, not a minor version bump.

I don't understand: Shouldn't a point release be 2.10.0 instead of 2.8.3? Like you agreed for SDL_ttf?

@slouken
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major release: 1.0.0 -> 2.0.0, backwards incompatible
minor release: 1.0.0 -> 1.1.0, backwards compatible, adds APIs
point release: 1.0.0 -> 1.0.1, backwards compatible, no added APIs, bug fixes only

@sezero
Copy link
Contributor

@sezero sezero commented on f960613 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ookkay - don't like it much but whatever

I cherry-picked a few commits from SDL2 branch in here, so make sure to update your local copies

Please sign in to comment.