Skip to content

Commit

Permalink
Use nightly.link for artifact download -> removes the need for PAT
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
Bromeon committed Nov 6, 2022
1 parent 84fbe94 commit a64f224
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
39 changes: 12 additions & 27 deletions .github/composite/godot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ inputs:
required: true
description: "Filename of the Godot executable"

github-pat:
required: true
description: "GitHub PAT (personal access token) to download artifacts from other repos"

rust-toolchain:
required: false
default: 'stable'
Expand All @@ -34,36 +30,26 @@ runs:
steps:
- uses: actions/checkout@v3

# Replaces also backspaces on Windows, since they cause problems in Bash
- name: "Store variable to Godot binary"
run: |
runnerDir=$(echo "${{ runner.temp }}" | sed "s!\\\\!/!")
echo "RUNNER_DIR=$runnerDir" >> $GITHUB_ENV
echo "GODOT4_BIN=$runnerDir/godot_bin/${{ inputs.binary-filename }}" >> $GITHUB_ENV
shell: bash

# - name: "Check cache for installed Godot version"
# id: "cache-godot"
# uses: actions/cache@v3
# with:
# path: ${{ runner.temp }}/godot_bin
# #key: godot-${{ runner.os }}-v${{ inputs.godot-ver }}
# key: ${{ inputs.artifact-name }}
# key: ${{ inputs.artifact-name }}-v${{ inputs.godot-ver }}

- name: "Download Godot artifact"
# if: steps.cache-godot.outputs.cache-hit != 'true'
# https://github.com/dawidd6/action-download-artifact
uses: dawidd6/action-download-artifact@v2
with:
# Downloads and unzips the artifact with {name} of the latest run of specified {workflow}
path: ${{ runner.temp }}/godot_bin
github_token: ${{ inputs.github-pat }}
repo: Bromeon/godot4-nightly
branch: master
workflow: compile-godot.yml
workflow_conclusion: success
name: ${{ inputs.artifact-name }}
# Search for the last workflow run, which stored an artifact named as in `name` input
search_artifacts: true

# Replaces also backspaces on Windows, since they cause problems in Bash
- name: "Store variable to Godot binary"
run: |
runnerDir=$(echo "${{ runner.temp }}" | sed "s!\\\\!/!")
echo "RUNNER_DIR=$runnerDir" >> $GITHUB_ENV
echo "GODOT4_BIN=$runnerDir/godot_bin/${{ inputs.binary-filename }}" >> $GITHUB_ENV
curl https://nightly.link/Bromeon/godot4-nightly/workflows/compile-godot/master/${{ inputs.artifact-name }}.zip -Lo artifact.zip
unzip artifact.zip -d $RUNNER_DIR/godot_bin
shell: bash

# The chmod seems still necessary, although applied before uploading artifact. Possibly modes are not preserved.
Expand Down Expand Up @@ -133,6 +119,7 @@ runs:
shell: bash

- name: "Conclusion"
if: always()
run: |
echo "Evaluate conclusion ($OUTCOME)"
Expand Down Expand Up @@ -165,6 +152,4 @@ runs:
exit 4
;;
esac
shell: bash
if: always()
2 changes: 1 addition & 1 deletion .github/external-config/licenserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ header:
- '.github/**/*.yml'

paths-ignore:
- 'demo-project'
- 'examples'

comment: on-failure

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/minimal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ jobs:
with:
artifact-name: godot-${{ matrix.name }}
binary-filename: ${{ matrix.godot-binary }}
github-pat: ${{ secrets.ARTIFACT_DOWNLOADER_PAT }}
#godot_ver: ${{ matrix.godot }}

license-guard:
Expand Down

0 comments on commit a64f224

Please sign in to comment.