Manual Beta Release Package Test #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual Beta Release Package Test | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: 'Specify package (i.e. "gl-publish-workflow-test-math")' | |
type: string | |
required: true | |
version: | |
description: "Beta Version (i.e. 4.0.0-beta.0)" | |
type: string | |
required: true | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
env: | |
PACKAGE_TO_PUBLISH: ${{ inputs.package }} | |
PACKAGE_BETA_VERSION: ${{ inputs.version }} | |
jobs: | |
beta-release: | |
name: Beta Release | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
beta_package_version_regex='^[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+$' | |
if ! [[ ${{ env.PACKAGE_BETA_VERSION }} =~ $beta_package_version_regex ]]; then | |
echo "Invalid version format" | |
exit 1 | |
fi | |
shell: bash | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: "yarn" | |
- run: yarn install | |
- run: yarn build-ci | |
- name: Update package.json version to beta version specified | |
run: | | |
yarn workspaces foreach -pt -v --no-private exec 'jq ".version = \"${{ env.PACKAGE_BETA_VERSION }}\"" package.json > package.tmp.json && mv package.tmp.json package.json' | |
shell: bash | |
- name: Build and publish beta package | |
run: yarn workspaces ${{ env.PACKAGE_TO_PUBLISH }} exec cat package.json |