Merge pull request #7572 from iosh/6181 #1503
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # This allows us to push to the repository and create GitHub releases | |
pull-requests: write # This allows us to create pull requests | |
id-token: write # Provenance generation in GitHub Actions requires "write" access to the "id-token" permission | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v5 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
# NOTE: If we use default GITHUB_TOKEN to create the release PR, the checks on the release PR will not be triggered automatically | |
token: ${{ secrets.RELEASE_GITHUB_TOKEN || github.token }} | |
- name: Set up the environment | |
uses: ./.github/actions/setup-env | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile --prefer-offline | |
- name: Create release Pull Request | |
id: pr | |
env: | |
# NOTE: If we use the default GITHUB_TOKEN to create the release PR, the checks on the release PR will not be triggered automatically | |
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN || github.token }} | |
uses: changesets/action@v1 | |
with: | |
title: Version Packages (v3) | |
version: pnpm version-for-release | |
- name: Build All Packages | |
if: steps.pr.outputs.hasChangesets == 'false' | |
run: pnpm run --recursive -no-bail --filter './v-next/**' --if-present build | |
- name: Publish All Packages (dry-run) | |
if: steps.pr.outputs.hasChangesets == 'false' | |
run: pnpm publish --filter "./v-next/**" -r --no-git-checks --access public --dry-run | |
- name: Publish All Packages | |
id: publish | |
if: steps.pr.outputs.hasChangesets == 'false' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true | |
run: pnpm publish --filter "./v-next/**" -r --no-git-checks --access public | |
- name: Create Git tags for packages | |
if: steps.pr.outputs.hasChangesets == 'false' | |
run: pnpm changeset tag | |
- name: Push Git tags | |
if: steps.pr.outputs.hasChangesets == 'false' | |
run: git push --follow-tags |