This Action containers two actions for Modern.js:
-
Create a pull request with all of the package versions updated and changelogs updated
-
Release packages to NPM and create Release to repo
- type: action type. Used to distinguish action execution action. Here is 'pull request'
- version: release type. Support 'latest', 'canary', 'alpha', 'pre'
- versionNumber: release version. Support like 'v1.x.x' or 'auto'. When you use auto, this action will get the first packages version after running bump version.
This action need to set REPO_SCOPED_TOKEN. You can read Creating a personal access token to create presonal access token.
Create Release Request for repository.
name: Release Pull Request
on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Type(canary, alpha, pre, latest)'
required: true
default: 'latest'
options:
- canary
- alpha
- pre
- latest
jobs:
release:
name: Create Release Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch only one branch to release
fetch-depth: 100
- name: Create Release Pull Request
uses: web-infra-dev/actions@main
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
version: ${{ github.event.inputs.version }}
versionNumber: 'auto'
type: 'pull request'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
- type: action type. Used to distinguish action execution action. Here is 'relesae'
- version: release type. Support 'latest', 'canary', 'alpha', 'pre'
- branch: release branch
This action need to set REPO_SCOPED_TOKEN. You can read Creating a personal access token to create presonal access token.
Runtime Modern Release to publish packages to NPM
name: Release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Version(canary, alpha, pre, latest)'
required: true
default: 'canary'
options:
- canary
- alpha
- pre
- latest
branch:
description: 'Release Branch(confirm release branch)'
required: true
default: 'main'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch only one branch to release
fetch-depth: 1
- name: Release
uses: web-infra-dev/actions@main
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
version: ${{ github.event.inputs.version }}
branch: ${{ github.event.inputs.branch }}
type: 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
MIT.