aboutsummaryrefslogtreecommitdiff
path: root/.github/actions/openvic-env/action.yml
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-07-17 21:39:41 +0200
committer Spartan322 <Megacake1234@gmail.com>2023-07-20 00:53:44 +0200
commit8a8be87279db46c5d50aedcb51b0ef2371c3484d (patch)
treeb81dd4bf0d661bb47e4f9c8219d2f0a547e546f2 /.github/actions/openvic-env/action.yml
parent1cb52daa06968aef519b66402ba6a3f4005000ee (diff)
Update to Godot 4.1.1 Stable Release
Add bash-based Godot URL environment variable handling to openvic-env action Sets GODOT_LINUX_URL and GODOT_TEMPLATE_URL according to GODOT_BASE_URL, GODOT_VERSION, and GODOT_VERSION_TYPE Handles downloads.tuxfamily.org/godotengine and github.com/godotengine differently Errors if GODOT_LINUX_URL or GODOT_TEMPLATE_URL are not set or if links do not exist Will not override GODOT_LINUX_URL if previously set Will not override GODOT_TEMPLATE_URL if previously set
Diffstat (limited to '.github/actions/openvic-env/action.yml')
-rw-r--r--.github/actions/openvic-env/action.yml40
1 files changed, 10 insertions, 30 deletions
diff --git a/.github/actions/openvic-env/action.yml b/.github/actions/openvic-env/action.yml
index acb428f..7c8c4e3 100644
--- a/.github/actions/openvic-env/action.yml
+++ b/.github/actions/openvic-env/action.yml
@@ -1,33 +1,13 @@
name: Setup OpenVic Environment
description: Setup OpenVic Environment
runs:
- using: "composite"
- steps:
- - name: Setup Environment
- uses: actions/github-script@v6
- with:
- script: |
- const commit_name = 'OPENVIC_COMMIT';
- const tag_name = 'OPENVIC_TAG';
- const release_name = 'OPENVIC_RELEASE';
- var commit_sha = process.env["GITHUB_SHA"];
- if(context.eventName === 'pull_request') {
- commit_sha = context.payload.pull_request.head.sha;
- }
- core.exportVariable(commit_name, commit_sha);
- try {
- const release = await github.rest.repos.getLatestRelease({owner: context.repo.owner, repo: context.repo.repo});
- core.exportVariable(tag_name, release.data["tag_name"]);
- core.exportVariable(release_name, release.data["name"]);
- } catch(error) {
- if (error.response.status != 404) throw error;
- const tagList = await github.rest.repos.listTags({owner: context.repo.owner, repo: context.repo.repo});
- if (tagList.data.length == 0) {
- core.warning("Could not list tags, this repo has no tags on it, setting tag_name and release_name environment variables to '<UserRepo-NoTag>' and '<UserRepo-NoRelease>', you can fetch tags with 'git fetch --tags' <remote-name>' and push tags with 'git push --tags");
- core.exportVariable(tag_name, `<${context.repo.owner}/${context.repo.repo}-NoTag>`);
- core.exportVariable(release_name, `<${context.repo.owner}/${context.repo.repo}-NoRelease>`);
- } else {
- core.exportVariable(tag_name, tagList.data[0].name);
- core.exportVariable(release_name, tagList.data[0].name);
- }
- } \ No newline at end of file
+ using: "composite"
+ steps:
+ - name: Setup URL Environment
+ shell: bash
+ run: ${GITHUB_ACTION_PATH}/url-environment.sh
+
+ - name: Setup Commit Environment
+ uses: actions/github-script@v6
+ with:
+ script: require(`${process.env.GITHUB_ACTION_PATH}/commit-environment.js`)({github, context, core})