From e50d6c126946c1dbe70469a2c9e197336840f59a Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Sat, 23 Nov 2024 12:03:50 -0800 Subject: [PATCH] Install pesde before trying to use it --- .github/actions/setup-pesde/action.yml | 31 ++++++++++++++++++++++++++ .github/workflows/ci.yml | 6 +++++ .github/workflows/release.yml | 9 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 .github/actions/setup-pesde/action.yml diff --git a/.github/actions/setup-pesde/action.yml b/.github/actions/setup-pesde/action.yml new file mode 100644 index 00000000..fc109881 --- /dev/null +++ b/.github/actions/setup-pesde/action.yml @@ -0,0 +1,31 @@ +# upstream: https://github.com/0x5eal/semver-luau/blob/main/.github/actions/setup-pesde/action.yml + +name: Install pesde +description: Installs pesde CLI and authenticates with the registry + +inputs: + pesde-token: + description: "Token for publishing to the pesde registry" + required: false + +runs: + using: composite + steps: + - name: Download pesde + shell: bash + run: | + latest_release=$(curl -s https://api.github.com/repos/daimond113/pesde/releases | jq '[.[] | select(.prerelease == true or .prerelease == false)][0]') + download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("linux-x86_64.tar.gz")) | .browser_download_url') + + curl -L -o /tmp/pesde.tar.gz "$download_url" + tar -xzvf /tmp/pesde.tar.gz + chmod +x pesde + + ./pesde self-install + rm ./pesde + echo "$HOME/.pesde/bin" >> $GITHUB_PATH + + - name: Authenticate into pesde registry + if: inputs.pesde-token != '' + shell: bash + run: pesde auth login --token "${{ inputs.pesde-token }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cba59387..a01d85dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install pesde + uses: ./.github/actions/setup-pesde + - name: Install packages run: pesde install --prod @@ -45,6 +48,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install pesde + uses: ./.github/actions/setup-pesde + - name: Setup Lune typedefs run: lune setup diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50ca31b0..c84f7721 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install pesde + uses: ./.github/actions/setup-pesde + - name: Get model file name run: | name=$(jq -r .name default.project.json) @@ -47,6 +50,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install pesde + uses: ./.github/actions/setup-pesde + - name: Install packages run: pesde install --prod @@ -65,6 +71,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install pesde + uses: ./.github/actions/setup-pesde + - name: Install packages run: pesde install