Skip to content

Commit

Permalink
chore: add workflow for release from prerelease (#6559)
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-MikeS authored May 3, 2023
1 parent 76afa22 commit f836420
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish-npm-latest-from-pre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish NPM Latest From Prerelease

on:
workflow_call:
secrets:
CAP_GH_RELEASE_TOKEN:
required: true
NPM_TOKEN:
required: true
workflow_dispatch:

permissions:
contents: write
id-token: write

jobs:
deploy-npm-latest:
if: github.ref == 'refs/heads/main'
runs-on: macos-12
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: '**/package.json'
- run: |
npm install
- name: Version & Publish
env:
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.name "Github Workflow (on behalf of ${{ github.actor }})"
git config user.email "users.noreply.github.com"
npm whoami
npm run ci:publish:latest-from-pre
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ci:publish:beta": "lerna version prerelease --conventional-commits --conventional-prerelease --preid beta --force-publish --yes && lerna exec -- npm publish --tag next --provenance",
"ci:publish:rc": "lerna version prerelease --conventional-commits --conventional-prerelease --preid rc --force-publish --yes && lerna exec -- npm publish --tag next --provenance",
"ci:publish:latest": "lerna version --conventional-commits --force-publish --yes && lerna exec -- npm publish --tag latest --provenance",
"ci:publish:latest-from-pre": "lerna version --conventional-commits --conventional-graduate --force-publish --yes && lerna exec -- npm publish --tag latest --provenance",
"ci:publish:dev": "lerna version prerelease --conventional-commits --conventional-prerelease --preid dev-$(date +\"%Y%m%dT%H%M%S\") --force-publish --no-changelog --no-git-tag-version --no-push --yes && lerna exec -- npm publish --tag dev --provenance",
"build:nativebridge": "lerna run build:nativebridge",
"sync-peer-dependencies": "node scripts/sync-peer-dependencies.mjs",
Expand Down

0 comments on commit f836420

Please sign in to comment.