Release Vue3 #14
This file contains hidden or 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: Release Vue3 | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 4 * * WED' | |
jobs: | |
Release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 # https://github.com/actions/checkout | |
with: | |
fetch-depth: 0 # https://github.com/actions/checkout/issues/217 | |
token: ${{ secrets.GH_TOKEN_LERNA }} # https://github.com/lerna/lerna/issues/1957 | |
ref: main | |
# https://github.com/actions/checkout#push-a-commit-using-the-built-in-token | |
- run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 # https://github.com/actions/setup-node | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org | |
- name: Install dependencies | |
run: yarn | |
- name: Continuous integration check & build | |
id: ci-check | |
run: | | |
yarn ci-check | |
git diff --quiet src/index.js || echo EXPORTS_UPDATED=true >> "$GITHUB_OUTPUT" | |
echo "### Changed exports" >> $GITHUB_STEP_SUMMARY | |
echo "```diff" >> $GITHUB_STEP_SUMMARY | |
git diff src/index.js >> $GITHUB_STEP_SUMMARY | |
echo "```" >> $GITHUB_STEP_SUMMARY | |
- name: Commit exports | |
if: ${{ steps.ci-check.outputs.EXPORTS_UPDATED == 'true' }} | |
run: | | |
git add src/index.js | |
git commit -m "new exports" | |
git push | |
# Dry run - `yarn lerna version prepatch --no-git-tag-version --no-push --yes` | |
# With dist tag - `run: yarn lerna publish prepatch --dist-tag next --yes` | |
- name: Publish | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
run: | | |
yarn lerna version patch --ignore-changes src/index.js --create-release github --yes | |
npm publish --provenance | |