From 397de4e3a7cd5e49662fa2b641092c6005c8c6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Jan 2023 16:47:37 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=91=B7=20Use=20original=20get-latest-?= =?UTF-8?q?release=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test_install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 18f6d7b39..a4de5ac48 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -56,9 +56,10 @@ jobs: steps: - name: 👀 Determine latest release id: latest - uses: foosel/github-action-get-latest-release@master + uses: pozetroninc/github-action-get-latest-release@master with: repository: "OctoPrint/OctoPrint" + excludes: prerelease,draft - name: 🐍 Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 with: From cc47b41baec17ffb003b550d143eda26167f17e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Jan 2023 17:06:43 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=91=B7=20Fetch=20latest=20release=20w?= =?UTF-8?q?ithout=20any=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bash, curl, awk ftw --- .github/workflows/test_install.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index a4de5ac48..dc0643c1b 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -55,25 +55,23 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: 👀 Determine latest release - id: latest - uses: pozetroninc/github-action-get-latest-release@master - with: - repository: "OctoPrint/OctoPrint" - excludes: prerelease,draft + run: | + OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | awk -F/ '{print $NF}') + echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV - name: 🐍 Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: 👷 Build and install latest release run: | - pip install https://github.com/OctoPrint/OctoPrint/archive/${{ steps.latest.outputs.release }}.zip + pip install https://github.com/OctoPrint/OctoPrint/archive/${{ env.OCTOPRINT_VERSION }}.zip - name: 📧 Discord success notification continue-on-error: true env: DISCORD_WEBHOOK: ${{ secrets.discord_webhook }} uses: Ilshidur/action-discord@master with: - args: "☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ steps.latest.outputs.release }}` was successful" + args: "☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` was successful" - name: 📧 Discord failure notification continue-on-error: true if: failure() @@ -81,4 +79,4 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.discord_webhook }} uses: Ilshidur/action-discord@master with: - args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ steps.latest.outputs.release }}` failed" + args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` failed" From c5b56ae11b5d176447a1edd2b4836a8c89f9062b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Jan 2023 17:15:30 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=91=B7=20Get=20rid=20of=20newline=20i?= =?UTF-8?q?n=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index dc0643c1b..22371c0b4 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -56,7 +56,7 @@ jobs: steps: - name: 👀 Determine latest release run: | - OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | awk -F/ '{print $NF}') + OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | awk -F/ '{print $NF}' | tr -d '\n') echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV - name: 🐍 Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 From 68191cfbf439c14f96879c1fbc8e87ce46ae37cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Jan 2023 17:38:26 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=92=9A=20HTTP=20has=20\r\n=20line=20e?= =?UTF-8?q?ndings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we need to strip \r, \n already gets taken care of by the whole pipe. Also limit to first location header just in case. --- .github/workflows/test_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 22371c0b4..925341c96 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -56,7 +56,7 @@ jobs: steps: - name: 👀 Determine latest release run: | - OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | awk -F/ '{print $NF}' | tr -d '\n') + OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | head -n1 | awk -F/ '{print $NF}' | tr -d '\r') echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV - name: 🐍 Set up Python ${{ matrix.python }} uses: actions/setup-python@v4