Skip to content

Commit 4a801fa

Browse files
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>
1 parent 7afe5c5 commit 4a801fa

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/publish-release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
permissions:
1515
id-token: write
16-
contents: read
16+
contents: write
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v5
@@ -57,6 +57,9 @@ jobs:
5757
- name: build
5858
run: npm run build
5959

60+
- name: build offline
61+
run: npm run build:offline
62+
6063
- name: Generate index.html in snapshot
6164
working-directory: .
6265
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:
6568
working-directory: .
6669
run: tar -cvf ../release.tar * && mv ../release.tar .
6770

71+
- name: Upload offline.zip to release
72+
env:
73+
GH_TOKEN: ${{ github.token }}
74+
run: gh release upload ${{ github.ref_name }} ./dist/offline.zip
75+
6876
- name: Configure AWS credentials
6977
uses: aws-actions/configure-aws-credentials@v5
7078
with:
@@ -73,6 +81,5 @@ jobs:
7381

7482
- name: Sync to S3
7583
run:
76-
| # Update /latest and create an explicitly versioned directory under releases/YYYY.MM.MICRO/
77-
aws s3 sync --quiet ./dist/ s3://pyscript.net/latest/
84+
| # Create an explicitly versioned directory under releases/YYYY.MM.MICRO/
7885
aws s3 sync --quiet ./dist/ s3://pyscript.net/releases/${{ github.ref_name }}/

public/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ <h2>Files</h2>
8484
<li><a href="core.css">core.css</a></li>
8585
<li><a href="core.js">core.js</a></li>
8686
<li><a href="core.js.map">core.js.map</a></li>
87+
<li>
88+
<a href="offline.zip">offline.zip</a> (PyScript _VERSION_
89+
zipped up for offline use)
90+
</li>
8791
</ul>
8892
<div id="out"></div>
8993
<script type="py">

0 commit comments

Comments
 (0)