From 4a801fa3a2777e77f4f0da4a59d57dffc638035e Mon Sep 17 00:00:00 2001 From: Nicholas Tollervey Date: Tue, 25 Nov 2025 09:37:14 +0000 Subject: [PATCH] Update `publish-release` GH workflow to automatically include the offline.zip asset. (#2411) * Update publish-release GH workflow to include offline.zip asset. * Adjust upload offline.zip to use gh CLI instead of a third party GH action. * Update release page template to reference offline.zip. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/publish-release.yml | 13 ++++++++++--- public/index.html | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index bba0522a..38dcfe3c 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write - contents: read + contents: write steps: - name: Checkout uses: actions/checkout@v5 @@ -57,6 +57,9 @@ jobs: - name: build run: npm run build + - name: build offline + run: npm run build:offline + - name: Generate index.html in snapshot working-directory: . run: sed -e 's#_PATH_#https://pyscript.net/releases/${{ github.ref_name }}/#' -e 's#_DOC_VERSION_#${{ github.ref_name }}#' -e 's#_TAG_VERSION_#/tag/${{ github.ref_name }}#' -e 's#_VERSION_#${{ github.ref_name }}#' ./public/index.html > ./core/dist/index.html @@ -65,6 +68,11 @@ jobs: working-directory: . run: tar -cvf ../release.tar * && mv ../release.tar . + - name: Upload offline.zip to release + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload ${{ github.ref_name }} ./dist/offline.zip + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v5 with: @@ -73,6 +81,5 @@ jobs: - name: Sync to S3 run: - | # Update /latest and create an explicitly versioned directory under releases/YYYY.MM.MICRO/ - aws s3 sync --quiet ./dist/ s3://pyscript.net/latest/ + | # Create an explicitly versioned directory under releases/YYYY.MM.MICRO/ aws s3 sync --quiet ./dist/ s3://pyscript.net/releases/${{ github.ref_name }}/ diff --git a/public/index.html b/public/index.html index 3ea49dd7..64cb079f 100644 --- a/public/index.html +++ b/public/index.html @@ -84,6 +84,10 @@
  • core.css
  • core.js
  • core.js.map
  • +
  • + offline.zip (PyScript _VERSION_ + zipped up for offline use) +