chore: work on its own branch #3
Workflow file for this run
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: Changesets | |
on: | |
push: | |
branches: | |
- chore/auto-release-on-vnext | |
jobs: | |
changesetcheck: | |
name: Changeset Check | |
runs-on: ubuntu-latest | |
outputs: | |
CHANGESETS: ${{ steps.changesetcheck.outputs.CHANGESETS }} | |
steps: | |
- name: checkout code repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: Install | |
run: pnpm install --no-frozen-lockfile | |
- name: Changeset Check | |
id: changesetcheck | |
run: | | |
pnpm changeset status --output=changes.json | |
if grep "\"releases\": \[\]," changes.json; then | |
echo "No changesets found." | |
echo "changesets=notfound" >> "$GITHUB_OUTPUT" | |
else | |
echo "Changesets found." | |
echo "changesets=found" >> "$GITHUB_OUTPUT" | |
fi | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: changesetcheck | |
if: needs.changesetcheck.outputs.CHANGESETS == 'found' | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: checkout code repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: Install | |
run: pnpm install --no-frozen-lockfile | |
- name: Apply and commit changesets | |
run: | | |
echo "Changesets found. Starting release." | |
pnpm changeset version | |
git config --global user.name "Github Actions" | |
git config --global user.email "[email protected]" | |
git commit -a -m "chore: v-next version bump" | |
# git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup npmrc | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.VNEXT_NPM_TOKEN }}" > .npmrc | |
- name: Publish | |
run: pnpm publish --filter "./v-next/**" -r --no-git-checks --tag next --access public --dry-run | |
env: | |
NPM_CONFIG_PROVENANCE: true |