Skip to content

Commit f3888df

Browse files
Release automation (pyscript#521)
* workflow updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * build release * remove if * test on main * update docs release workflow Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9274f9e commit f3888df

File tree

3 files changed

+66
-18
lines changed

3 files changed

+66
-18
lines changed

.github/workflows/build-release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: '[CI] Build Release'
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
env:
9+
MINICONDA_PYTHON_VERSION: py38
10+
MINICONDA_VERSION: 4.11.0
11+
12+
defaults:
13+
run:
14+
working-directory: pyscriptjs
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Install node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 18.x
28+
29+
- name: Cache node modules
30+
uses: actions/cache@v3
31+
env:
32+
cache-name: cache-node-modules
33+
with:
34+
# npm cache files are stored in `~/.npm` on Linux/macOS
35+
path: ~/.npm
36+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-build-${{ env.cache-name }}-
39+
${{ runner.os }}-build-
40+
${{ runner.os }}-
41+
42+
- name: setup Miniconda
43+
uses: conda-incubator/setup-miniconda@v2
44+
45+
- name: Setup Environment
46+
run: make setup
47+
48+
- name: Build and Test
49+
run: make test
50+
51+
- name: Prepare Release
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
draft: true
55+
prerelease: true
56+
generate_release_notes: true

.github/workflows/docs-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
name: '[Docs] Build Release'
22

33
on:
4-
# Any time a tag or branch is created
5-
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#create
6-
create:
7-
paths:
8-
- docs/**
4+
release:
5+
types: [published]
96

107
jobs:
118
build:
12-
if: startsWith(github.ref, 'refs/tags') # Only if tagged
139
runs-on: ubuntu-latest
1410
permissions:
1511
contents: read

.github/workflows/build-alpha.yml renamed to .github/workflows/publish-release.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: '[CI] Build Alpha'
1+
name: '[CI] Publish Release'
22

33
on:
4-
push:
5-
tags:
6-
- '**' # Currently any tag, need to slim down
7-
paths:
8-
- pyscriptjs/**
4+
release:
5+
types: [published]
96

107
env:
118
MINICONDA_PYTHON_VERSION: py38
@@ -22,7 +19,6 @@ jobs:
2219
contents: read
2320
id-token: write
2421
steps:
25-
2622
- name: Checkout
2723
uses: actions/checkout@v3
2824

@@ -53,14 +49,14 @@ jobs:
5349
- name: Build and Test
5450
run: make test
5551

56-
# Deploy to S3
52+
# Upload to S3
5753
- name: Configure AWS credentials
58-
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
5954
uses: aws-actions/configure-aws-credentials@v1.6.1
6055
with:
6156
aws-region: ${{secrets.AWS_REGION}}
6257
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
6358

64-
- name: Sync to S3
65-
if: github.ref == 'refs/heads/main'
66-
run: aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/
59+
# - name: Sync to S3
60+
# run: | # Overwrite "latest" alpha + versioned subdirectory
61+
# aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/${{ github.ref_name }}
62+
# aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/

0 commit comments

Comments
 (0)