Skip to content

Commit

Permalink
fuck action_path man
Browse files Browse the repository at this point in the history
  • Loading branch information
cgytrus authored Feb 13, 2024
1 parent ec20380 commit 55dc34e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
27 changes: 10 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ outputs:
runs:
using: composite
steps:
- name: Set Real Action Path
id: action-path
shell: bash
run: |
export REAL_PATH=$(realpath "${{ github.action_path }}")
echo "path=$REAL_PATH" >> $GITHUB_OUTPUT
- name: Detect platform
id: platform
shell: bash
Expand Down Expand Up @@ -169,32 +162,32 @@ runs:
fileName: "*-${{ steps.platform.outputs.id }}.zip"
tarBall: false
zipBall: false
out-file-path: "${{ steps.action-path.outputs.path }}/cli"
out-file-path: "cli"

- name: Setup CLI
shell: bash
run: |
7z x "${{ steps.action-path.outputs.path }}/cli/*-${{ steps.platform.outputs.id }}.zip" -o"${{ steps.action-path.outputs.path }}/cli"
echo "${{ steps.action-path.outputs.path }}/cli" >> $GITHUB_PATH
7z x "cli/*-${{ steps.platform.outputs.id }}.zip" -ocli
echo "cli" >> $GITHUB_PATH
if [ ${{ steps.platform.outputs.id }} != "win" ]; then
chmod +x "${{ steps.action-path.outputs.path }}/cli/geode"
chmod +x "cli/geode"
fi
- name: Setup Geode SDK
shell: bash
run: |
export CLI_PROFILE="${{ steps.action-path.outputs.path }}/cli-profile"
export CLI_PROFILE="${{ github.workspace }}/cli-profile"
# for windows
mkdir -p "$CLI_PROFILE/geode/mods"
# for mac
mkdir -p "$CLI_PROFILE/Contents/geode/mods"
geode profile add --name GithubActions "$CLI_PROFILE"
geode sdk install "${{ steps.action-path.outputs.path }}/geode-sdk-clone"
geode sdk install "${{ github.workspace }}/geode-sdk-clone"
# silly github actions wont refresh the env
export GEODE_SDK="${{ steps.action-path.outputs.path }}/geode-sdk-clone"
export GEODE_SDK="${{ github.workspace }}/geode-sdk-clone"
echo "GEODE_SDK=$GEODE_SDK" >> $GITHUB_ENV
if [ "${{ inputs.sdk }}" == "latest" ]; then
Expand Down Expand Up @@ -231,13 +224,13 @@ runs:
cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build-config }} -G Ninja $CMAKE_EXTRA_ARGS -DGEODE_CODEGEN_CMAKE_ARGS="$CMAKE_CODEGEN_ARGS" -DGEODE_DONT_INSTALL_MODS=ON -DGEODE_TARGET_PLATFORM=${{ steps.platform.outputs.target }} ${{ inputs.configure-args }}
cmake --build build --config ${{ inputs.build-config }} ${{ inputs.build-args }}
mkdir "${{ steps.action-path.outputs.path }}/output"
mkdir "${{ github.workspace }}/output"
for file in $(find ./build -name *.geode); do
cp $file "${{ steps.action-path.outputs.path }}/output"
cp $file "${{ github.workspace }}/output"
done
OUTPUT_DIR="${{ steps.action-path.outputs.path }}/output"
OUTPUT_DIR="${{ github.workspace }}/output"
if [ ${{ steps.platform.outputs.id }} = "mac" ]; then
OUTPUT_DIR=$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$OUTPUT_DIR")
elif [ ${{ steps.platform.outputs.id }} = "win" ]; then
Expand Down
20 changes: 6 additions & 14 deletions combine/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ outputs:
runs:
using: composite
steps:
- name: Set Real Action Path
id: action-path
shell: bash
run: |
export REAL_PATH=$(realpath "${{ github.action_path }}")
echo "path=$REAL_PATH" >> $GITHUB_OUTPUT
- name: Detect platform
id: platform
shell: bash
Expand All @@ -48,27 +41,26 @@ runs:
fileName: "*-${{ steps.platform.outputs.id }}.zip"
tarBall: false
zipBall: false
out-file-path: "${{ steps.action-path.outputs.path }}/cli"
out-file-path: "cli"

- name: Setup CLI
shell: bash
run: |
7z x "${{ steps.action-path.outputs.path }}/cli/*-${{ steps.platform.outputs.id }}.zip" -o"${{ steps.action-path.outputs.path }}/cli"
echo "${{ steps.action-path.outputs.path }}/cli" >> $GITHUB_PATH
7z x "cli/*-${{ steps.platform.outputs.id }}.zip" -ocli
echo "cli" >> $GITHUB_PATH
if [ ${{ steps.platform.outputs.id }} != "win" ]; then
chmod +x "${{ steps.action-path.outputs.path }}/cli/geode"
chmod +x "cli/geode"
fi
- uses: actions/download-artifact@v4
with:
path: "${{ steps.action-path.outputs.path }}/artifacts"
path: artifacts

- name: Combine them
shell: bash
id: merge
run: |
cd "${{ steps.action-path.outputs.path }}"
chmod +x ./geode
mkdir out
MODS=$(find . -name *.geode -type f -printf "%f\n" | sort -u)
Expand All @@ -94,7 +86,7 @@ runs:
fi
cp $FIRST out
done
echo "output=${{ steps.action-path.outputs.path }}/out" >> $GITHUB_OUTPUT
echo "output=${{ github.workspace }}/out" >> $GITHUB_OUTPUT
- uses: geekyeggo/delete-artifact@v4
if: ${{ inputs.delete-artifacts }}
Expand Down

0 comments on commit 55dc34e

Please sign in to comment.