mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-06 06:38:39 -05:00
Release automation (#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>
This commit is contained in:
56
.github/workflows/build-release.yml
vendored
Normal file
56
.github/workflows/build-release.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: '[CI] Build Release'
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
env:
|
||||
MINICONDA_PYTHON_VERSION: py38
|
||||
MINICONDA_VERSION: 4.11.0
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: pyscriptjs
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: setup Miniconda
|
||||
uses: conda-incubator/setup-miniconda@v2
|
||||
|
||||
- name: Setup Environment
|
||||
run: make setup
|
||||
|
||||
- name: Build and Test
|
||||
run: make test
|
||||
|
||||
- name: Prepare Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
8
.github/workflows/docs-release.yml
vendored
8
.github/workflows/docs-release.yml
vendored
@@ -1,15 +1,11 @@
|
||||
name: '[Docs] Build Release'
|
||||
|
||||
on:
|
||||
# Any time a tag or branch is created
|
||||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#create
|
||||
create:
|
||||
paths:
|
||||
- docs/**
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: startsWith(github.ref, 'refs/tags') # Only if tagged
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
name: '[CI] Build Alpha'
|
||||
name: '[CI] Publish Release'
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**' # Currently any tag, need to slim down
|
||||
paths:
|
||||
- pyscriptjs/**
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
MINICONDA_PYTHON_VERSION: py38
|
||||
@@ -22,7 +19,6 @@ jobs:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
@@ -53,14 +49,14 @@ jobs:
|
||||
- name: Build and Test
|
||||
run: make test
|
||||
|
||||
# Deploy to S3
|
||||
# Upload to S3
|
||||
- name: Configure AWS credentials
|
||||
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
|
||||
uses: aws-actions/configure-aws-credentials@v1.6.1
|
||||
with:
|
||||
aws-region: ${{secrets.AWS_REGION}}
|
||||
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
|
||||
|
||||
- name: Sync to S3
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/
|
||||
# - name: Sync to S3
|
||||
# run: | # Overwrite "latest" alpha + versioned subdirectory
|
||||
# aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/${{ github.ref_name }}
|
||||
# aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/
|
||||
Reference in New Issue
Block a user