Skip to content

Commit 91ae242

Browse files
authored
Build unstable (#1736)
* Add build unstable * update publish snapshot * naming action and steps
1 parent fd307e5 commit 91ae242

8 files changed

Lines changed: 53 additions & 223 deletions

File tree

.github/workflows/publish-snapshot.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
type: string
99
required: true
1010

11+
defaults:
12+
run:
13+
working-directory: pyscript.core
14+
1115
jobs:
1216
publish-snapshot:
1317
runs-on: ubuntu-latest
@@ -17,8 +21,6 @@ jobs:
1721
steps:
1822
- name: Checkout
1923
uses: actions/checkout@v4
20-
with:
21-
ref: main
2224

2325
- name: Install node
2426
uses: actions/setup-node@v3
@@ -38,12 +40,10 @@ jobs:
3840
${{ runner.os }}-build-
3941
${{ runner.os }}-
4042
41-
- name: Install Dependencies
42-
working-directory: ./pyscript.core
43+
- name: Install Dependencies
4344
run: npm install
4445

4546
- name: Build Pyscript.core
46-
working-directory: ./pyscript.core
4747
run: npm run build
4848

4949
- name: Configure AWS credentials
@@ -57,6 +57,5 @@ jobs:
5757
run: sed 's#_PATH_#https://pyscript.net/snapshots/${{ inputs.snapshot_version }}/#' ./public/index.html > ./pyscript.core/dist/index.html
5858

5959
- name: Copy to Snapshot
60-
working-directory: ./pyscript.core/dist
6160
run: >
62-
aws s3 sync . s3://pyscript.net/snapshots/${{ inputs.snapshot_version }}/
61+
aws s3 sync ./dist/ s3://pyscript.net/snapshots/${{ inputs.snapshot_version }}/
Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: "[CI] Build Unstable"
1+
name: "Publish Unstable"
22

33
on:
44
push: # Only run on merges into main that modify files under pyscriptjs/ and examples/
55
branches:
66
- main
77
paths:
8-
- pyscriptjs/**
8+
- pyscript.core/**
99
- examples/**
1010
- .github/workflows/build-unstable.yml # Test that workflow works when changed
1111

@@ -19,17 +19,14 @@ on:
1919
workflow_dispatch:
2020

2121
jobs:
22-
BuildAndTest:
22+
build-unstable:
2323
runs-on: ubuntu-latest
2424
defaults:
2525
run:
26-
working-directory: pyscriptjs
27-
env:
28-
MINICONDA_PYTHON_VERSION: py38
29-
MINICONDA_VERSION: 4.11.0
26+
working-directory: pyscript.core
3027
steps:
3128
- name: Checkout
32-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3330

3431
- name: Install node
3532
uses: actions/setup-node@v3
@@ -49,49 +46,32 @@ jobs:
4946
${{ runner.os }}-build-
5047
${{ runner.os }}-
5148
52-
- name: setup Miniconda
53-
uses: conda-incubator/setup-miniconda@v2
54-
55-
- name: Setup Environment
56-
run: make setup
49+
- name: NPM Install
50+
run: npm install
5751

5852
- name: Build
59-
run: make build
60-
61-
- name: TypeScript Tests
62-
run: make test-ts
63-
64-
- name: Python Tests
65-
run: make test-py
66-
67-
- name: Integration Tests
68-
run: make test-integration-parallel
69-
70-
- name: Examples Tests
71-
run: make test-examples
53+
run: npm run build
54+
55+
- name: Generate index.html in snapshot
56+
working-directory: .
57+
run: sed 's#_PATH_#https://pyscript.net/unstable/#' ./public/index.html > ./pyscript.core/dist/index.html
7258

7359
- uses: actions/upload-artifact@v3
7460
with:
7561
name: pyscript
7662
path: |
77-
pyscriptjs/build/
63+
pyscript.core/dist/
7864
if-no-files-found: error
7965
retention-days: 7
8066

81-
- uses: actions/upload-artifact@v3
82-
if: success() || failure()
83-
with:
84-
name: test_results
85-
path: pyscriptjs/test_results
86-
if-no-files-found: error
8767
eslint:
8868
runs-on: ubuntu-latest
8969
defaults:
9070
run:
91-
working-directory: pyscriptjs
71+
working-directory: pyscript.core
9272
steps:
9373
- name: Checkout
94-
uses: actions/checkout@v3
74+
uses: actions/checkout@v4
9575

9676
- name: Install node
9777
uses: actions/setup-node@v3
@@ -117,9 +97,12 @@ jobs:
11797
- name: Eslint
11898
run: npx eslint src -c .eslintrc.js
11999

120-
Deploy:
100+
publish-unstable:
121101
runs-on: ubuntu-latest
122-
needs: BuildAndTest
102+
defaults:
103+
run:
104+
working-directory: pyscript.core
105+
needs: build-unstable
123106
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
124107
permissions:
125108
contents: read
@@ -129,7 +112,7 @@ jobs:
129112
- uses: actions/download-artifact@v3
130113
with:
131114
name: pyscript
132-
path: ./build/
115+
path: ./dist/
133116

134117
# Deploy to S3
135118
- name: Configure AWS credentials
@@ -139,4 +122,4 @@ jobs:
139122
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
140123

141124
- name: Sync to S3
142-
run: aws s3 sync --quiet ./build/ s3://pyscript.net/unstable/
125+
run: aws s3 sync --quiet ./dist/ s3://pyscript.net/unstable/

workflows/prepare-release.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ on:
55
tags:
66
- "[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9]+" # YYYY.MM.MICRO
77

8-
env:
9-
MINICONDA_PYTHON_VERSION: py38
10-
MINICONDA_VERSION: 4.11.0
11-
128
defaults:
139
run:
14-
working-directory: pyscriptjs
10+
working-directory: pyscript.core
1511

1612
jobs:
17-
build:
13+
prepare-release:
1814
runs-on: ubuntu-latest
1915
steps:
2016
- name: Checkout
21-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
2218

2319
- name: Install node
2420
uses: actions/setup-node@v3
@@ -38,17 +34,18 @@ jobs:
3834
${{ runner.os }}-build-
3935
${{ runner.os }}-
4036
41-
- name: setup Miniconda
42-
uses: conda-incubator/setup-miniconda@v2
37+
- name: NPM Install
38+
run: npm install
4339

44-
- name: Setup Environment
45-
run: make setup
40+
- name: Build
41+
run: npm run build
4642

47-
- name: Build and Test
48-
run: make test
43+
- name: Generate index.html
44+
working-directory: .
45+
run: sed 's#_PATH_#https://pyscript.net/snapshots/${{ inputs.snapshot_version }}/#' ./public/index.html > ./pyscript.core/dist/index.html
4946

50-
- name: Zip build folder
51-
run: zip -r -q ./build.zip ./build
47+
- name: Zip dist folder
48+
run: zip -r -q ./build.zip ./dist
5249

5350
- name: Prepare Release
5451
uses: softprops/action-gh-release@v1

workflows/publish-release.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@ on:
44
release:
55
types: [published]
66

7-
env:
8-
MINICONDA_PYTHON_VERSION: py38
9-
MINICONDA_VERSION: 4.11.0
10-
117
defaults:
128
run:
13-
working-directory: pyscriptjs
9+
working-directory: pyscript.core
1410

1511
jobs:
16-
build:
12+
publish-release:
1713
runs-on: ubuntu-latest
1814
permissions:
1915
contents: read
2016
id-token: write
2117
steps:
2218
- name: Checkout
23-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2420

2521
- name: Install node
2622
uses: actions/setup-node@v3
@@ -40,16 +36,16 @@ jobs:
4036
${{ runner.os }}-build-
4137
${{ runner.os }}-
4238
43-
- name: setup Miniconda
44-
uses: conda-incubator/setup-miniconda@v2
45-
46-
- name: Setup Environment
47-
run: make setup
39+
- name: npm install
40+
run: npm install
4841

49-
- name: Build and Test
50-
run: make test
42+
- name: build
43+
run: npm run build
44+
45+
- name: Generate index.html in snapshot
46+
working-directory: .
47+
run: sed 's#_PATH_#https://pyscript.net/snapshots/${{ inputs.snapshot_version }}/#' ./public/index.html > ./pyscript.core/dist/index.html
5148

52-
# Upload to S3
5349
- name: Configure AWS credentials
5450
uses: aws-actions/configure-aws-credentials@v1.6.1
5551
with:
@@ -59,5 +55,5 @@ jobs:
5955
- name: Sync to S3
6056
run:
6157
| # Update /latest and create an explicitly versioned directory under releases/YYYY.MM.MICRO/
62-
aws s3 sync --quiet ./build/ s3://pyscript.net/latest/
63-
aws s3 sync --quiet ./build/ s3://pyscript.net/releases/${{ github.ref_name }}/
58+
aws s3 sync --quiet ./dist/ s3://pyscript.net/latest/
59+
aws s3 sync --quiet ./dist/ s3://pyscript.net/releases/${{ github.ref_name }}/

workflows/publish-snapshot.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

workflows/sync-examples.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)