Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
promer94 committed May 15, 2023
2 parents c9f0c5e + 8e291a9 commit b13bc01
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,23 @@ jobs:
- name: Install
uses: ./.github/workflows/install

- name: Release
run: pnpm publish --access public --no-git-checks --provenance
- name: Determine tag
id: determine_tag
run: |
echo "tag=$(echo $GITHUB_REF | grep -Eo 'alpha|beta|canary|rc')" >> $GITHUB_OUTPUT
- name: Publish to versioned tag
if: steps.determine_tag.outputs.tag != ''
run: |
echo "Publishing to ${{ steps.determine_tag.outputs.tag }} tag"
npm publish --access public --no-git-checks --provenance --tag ${{ steps.determine_tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}

- name: Publish to latest
if: steps.determine_tag.outputs.tag == ''
run: |
echo "Publishing to latest"
npm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
92 changes: 92 additions & 0 deletions .github/workflows/trigger-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
on:
workflow_dispatch:
inputs:
releaseType:
description: Release stable or beta?
required: true
type: choice
options:
- beta
- stable

semverType:
description: semver type?
type: choice
options:
- patch
- minor
- major

secrets:
RELEASE_BOT_TOKEN:
required: true

name: Trigger Release

env:
PNPM_VERSION: 7.26.1


jobs:
start:
runs-on: ubuntu-latest1

environment: release-${{ github.event.inputs.releaseType }}
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{ steps.docs-change.outputs.docsChange == 'nope' }}
with:
node-version: 18
check-latest: true

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10

- run: npm i -g pnpm@${PNPM_VERSION}

- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT

- uses: actions/cache@v3
timeout-minutes: 5
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install

- run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm test:build
- name: Configure git
run: |
git config user.name "vercel-release-bot"
git config user.email "[email protected]"
- name: Tag beta
if: ${{ github.event.inputs.releaseType === 'beta' }}
run: npm version prerelease --preid=beta

- name: Tag stable
if: ${{ github.event.inputs.releaseType === 'stable' }}
run: npm version ${{ github.event.inputs.releaseType }}

- name: Git push
env:
RELEASE_BOT_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
run: |
git push origin main
git push origin --tags

0 comments on commit b13bc01

Please sign in to comment.