From 15b8cd024d0e107422616d50e49f2ed34a03ed64 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 04:53:31 +0000 Subject: [PATCH 1/6] chore(CI): publish nightly builds even for tagged releases --- .github/workflows/test-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index ca4cc8fc..143217e9 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -297,7 +297,7 @@ jobs: publish: needs: [build-and-test, sdist] runs-on: ubuntu-20.04 - if: ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + if: ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }} steps: # no need to checkout - uses: actions/setup-python@v5 @@ -320,7 +320,7 @@ jobs: # and deploy the static files to GitHub Pages needs: [build-and-test, sdist] runs-on: ubuntu-20.04 - if: ${{ (success() || failure()) && github.ref_name == 'main' }} # publish nightly builds regardless of tests failure + if: ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }} # publish nightly builds regardless of tests failure permissions: # grant GITHUB_TOKEN the permissions required to make a Pages deployment pages: write id-token: write From 412ca1055f95acd5e9e30a1b7706393d09e55821 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 04:58:37 +0000 Subject: [PATCH 2/6] fix(CI): trigger CI only on release tags instead of all tags --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 143217e9..2ac3e699 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -5,7 +5,7 @@ on: branches: - main tags: - - '*' + - 'v*' workflow_call: workflow_dispatch: inputs: From 4ee52daa4c0505ce93f4233797c3129aa90eaec9 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 05:03:11 +0000 Subject: [PATCH 3/6] chore(CI): only allow one concurrent CI run for a single branch --- .github/workflows/test-and-publish.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 2ac3e699..c77a083f 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -54,6 +54,10 @@ defaults: # run with Git Bash on Windows shell: bash +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-spidermonkey-unix: strategy: From 0fa946f6e6f893e3aa5110062829b9d155305f8e Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 05:53:04 +0000 Subject: [PATCH 4/6] =?UTF-8?q?CI:=20publish=20to=20=E2=8A=87istributive's?= =?UTF-8?q?=20archive=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit URL: https://archive.distributed.computer/releases/pythonmonkey/ --- .github/workflows/test-and-publish.yaml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index c77a083f..814be3c0 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -379,3 +379,44 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 + publish-archive: + # Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/) + needs: [build-and-test, sdist] + runs-on: ubuntu-20.04 + if: ${{ (success() || failure()) && true }} # (github.ref_name == 'main' || github.ref_type == 'tag') + environment: + name: archive + url: https://archive.distributed.computer/releases/pythonmonkey/${{ steps.get_path.outputs.ARCHIVE_PATH }} + steps: + # no need to checkout + - name: Download wheels built + uses: actions/download-artifact@v3 + with: + name: wheel-${{ github.run_id }}-${{ github.sha }} + path: ./ + - name: Download docs html generated by Doxygen + uses: actions/download-artifact@v3 + with: + name: docs-${{ github.run_id }}-${{ github.sha }} + path: ./docs/ + - name: Get the pythonmonkey/pminit version number + run: | + file=$(ls ./pminit*.tar.gz | head -1) + pm_version=$(basename "${file%.tar.gz}" | cut -d- -f2) # match /pminit-([^-]+).tar.gz/ + echo "PM_VERSION=$pm_version" >> $GITHUB_ENV + - name: Get the archive type (nightly or releases) and path + id: get_path + run: | + path="$ARCHIVE_TYPE/$PM_VERSION/" + echo "$path" + echo "ARCHIVE_PATH=$path" >> $GITHUB_OUTPUT + env: + ARCHIVE_TYPE: ${{ (github.ref_type == 'tag' && 'releases') || 'nightly' }} + - name: SCP to the archive server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.ARCHIVE_HOST }} + username: ${{ secrets.ARCHIVE_USERNAME }} + key: ${{ secrets.ARCHIVE_KEY }} + source: ./* + target: ${{ steps.get_path.outputs.ARCHIVE_PATH }} From 7e9f53c5c16d7927d551839a2f0c2853d7e47b4d Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 06:09:59 +0000 Subject: [PATCH 5/6] =?UTF-8?q?fix(CI):=20publishing=20to=20=E2=8A=87istri?= =?UTF-8?q?butive's=20archive=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 814be3c0..9eb33d4a 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -416,7 +416,7 @@ jobs: uses: appleboy/scp-action@v0.1.7 with: host: ${{ secrets.ARCHIVE_HOST }} - username: ${{ secrets.ARCHIVE_USERNAME }} + username: pythonmonkey key: ${{ secrets.ARCHIVE_KEY }} source: ./* - target: ${{ steps.get_path.outputs.ARCHIVE_PATH }} + target: archive/${{ steps.get_path.outputs.ARCHIVE_PATH }} From b774b58a7517e6f9c1714628c72c531e980ae27f Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 10 Sep 2024 06:29:07 +0000 Subject: [PATCH 6/6] fix(CI): publishing to the archive server only for nightly&release builds --- .github/workflows/test-and-publish.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 9eb33d4a..c0261c67 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -383,7 +383,7 @@ jobs: # Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/) needs: [build-and-test, sdist] runs-on: ubuntu-20.04 - if: ${{ (success() || failure()) && true }} # (github.ref_name == 'main' || github.ref_type == 'tag') + if: ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }} environment: name: archive url: https://archive.distributed.computer/releases/pythonmonkey/${{ steps.get_path.outputs.ARCHIVE_PATH }} @@ -420,3 +420,4 @@ jobs: key: ${{ secrets.ARCHIVE_KEY }} source: ./* target: archive/${{ steps.get_path.outputs.ARCHIVE_PATH }} + overwrite: true