fix: generate correct download on stable releases (#19)

This commit is contained in:
Joanna May 2023-03-02 21:39:00 -06:00 committed by GitHub
parent 0f0c9d412c
commit 7841bee43b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11987 additions and 12028 deletions

View File

@ -37,7 +37,7 @@ jobs:
with:
# Version must include major, minor, and patch, and be >= 4.0.0
# Pre-release label is optional.
version: 4.0.0-beta16
version: 4.0.0
- name: 🔬 Verify Setup
run: |

View File

@ -1,12 +1,17 @@
# Setup Godot
Setup Godot for headless use with macOS, Windows, and Linux CI/CD runners.
[![Chickensoft Badge][chickensoft-badge]][chickensoft-website] [![Discord][discord-badge]][discord]
- ✅ Godot 4 Only.
- ✅ Setup and run Godot on the OS you are developing for.
- ✅ Caches Godot 4 installation for speedier workflows.
Setup Godot for use with .NET on macOS, Windows, and Linux CI/CD runners.
- ✅ Godot 4.x
- ✅ C# supported using .NET version of Godot.
- ✅ Installs Godot directly on the CI/CD runner.
- ✅ Caches Godot installation for speedier workflows.
- ✅ Adds environment variables (`GODOT4`, `GODOT`) to the system path.
- ✅ Installs Godot on the runner — do whatever you want with it afterwards!
- ✅ Runs on macOS Github Actions runner.
- ✅ Runs on Windows Github Actions runner.
- ✅ Runs on Ubuntu Github Actions runner.
> **Godot 3.x and below are not supported.**
@ -48,12 +53,12 @@ jobs:
- name: 📦 Restore Dependencies
run: dotnet restore
- uses: chickensoft-games/setup-godot
- uses: chickensoft-games/setup-godot@v1
name: 🤖 Setup Godot
with:
# Version must include major, minor, and patch, and be >= 4.0.0
# Pre-release label is optional.
version: 4.0.0-beta16
version: 4.0.0-beta16 # also valid: 4.0.0.rc1 or 4.0.0, etc
- name: 🔬 Verify Setup
run: |
@ -68,3 +73,11 @@ jobs:
# Do whatever you want!
```
<!-- Links -->
<!-- Header -->
[chickensoft-badge]: https://chickensoft.games/images/chickensoft/chickensoft_badge.svg
[chickensoft-website]: https://chickensoft.games
[discord]: https://discord.gg/gSjaPgMmYW
[discord-badge]: https://img.shields.io/badge/Chickensoft%20Discord-%237289DA.svg?style=flat&logo=discord&logoColor=white

View File

@ -63,13 +63,13 @@ describe('getGodotUrl', () => {
})
test('4.0.0', () => {
expect(getGodotUrl('4.0.0', getPlatform('linux'))).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0_mono_linux_x86_64.zip'
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_linux_x86_64.zip'
)
expect(getGodotUrl('4.0.0', getPlatform('win32'))).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0_mono_win64.zip'
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_win64.zip'
)
expect(getGodotUrl('4.0.0', getPlatform('darwin'))).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0_mono_macos.universal.zip'
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_macos.universal.zip'
)
})
})

3
dist/index.js generated vendored
View File

@ -329,6 +329,9 @@ function getGodotFilename(version, platform) {
if (label !== '') {
filename += `-${label}`;
}
else {
filename += '-stable';
}
return filename + platform.godotFilenameSuffix;
}
exports.getGodotFilename = getGodotFilename;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

1487
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
{
"name": "setup-godot",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"description": "Setup Godot for headless use with macOS, Windows, and Linux runners.",
"description": "Setup Godot for use with .NET on macOS, Windows, and Linux CI/CD runners.",
"main": "lib/main.js",
"scripts": {
"build": "tsc",
@ -32,15 +32,15 @@
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@typescript-eslint/parser": "^5.50.0",
"@types/node": "^18.14.2",
"@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.33.0",
"eslint-plugin-github": "^4.6.0",
"eslint-plugin-github": "^4.6.1",
"eslint-plugin-jest": "^27.2.1",
"jest": "^29.4.1",
"jest": "^29.4.3",
"js-yaml": "^4.1.0",
"prettier": "^2.8.3",
"prettier": "^2.8.4",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
}

View File

@ -133,6 +133,8 @@ export function getGodotFilename(
}
if (label !== '') {
filename += `-${label}`
} else {
filename += '-stable'
}
return filename + platform.godotFilenameSuffix