-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full Changesets usage to automate releases (#174)
* Full Changesets usage to automate releases * add better changesets changelogs fn * Add `next` preview * adjust github changelog * add short-sha to next preview version
- Loading branch information
Showing
9 changed files
with
139 additions
and
211 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ "repo": "TBD54566975/tbdex-js" } | ||
], | ||
"commit": false, | ||
"fixed": [["@tbdex/protocol", "@tbdex/http-client", "@tbdex/http-server"]], | ||
"linked": [], | ||
"access": "restricted", | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
# prevents this action from running on forks | ||
if: github.repository == 'TBD54566975/tbdex-js' | ||
permissions: | ||
contents: write # to create release (changesets/action) | ||
pull-requests: write # to create pull request (changesets/action) | ||
id-token: write # necessary for NPM provenance | ||
|
||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
published: ${{ steps.changesets.outputs.published }} | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
submodules: "true" | ||
|
||
- name: install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Verify NPM token is authenticated with NPMjs.com | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpm whoami | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build all workspace packages | ||
run: pnpm build | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
uses: changesets/action@v1 | ||
id: changesets | ||
with: | ||
publish: pnpm changeset publish | ||
version: pnpm changeset version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish `next` preview | ||
if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.pullRequestNumber != '' && steps.changesets.outputs.hasChangesets == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
git checkout main | ||
SHORT_SHA=$(git rev-parse --short HEAD) | ||
pnpm changeset version --snapshot next-$SHORT_SHA | ||
pnpm changeset publish --no-git-tag --tag next | ||
publish-docs: | ||
needs: release | ||
name: Publish Docs | ||
if: ${{ needs.release.outputs.published == 'true' }} | ||
uses: ./.github/workflows/docs-publish.yml |
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
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
Oops, something went wrong.