generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup Changesets * Update CONTRIBUTING.md Co-authored-by: Jiyoon Koo <[email protected]> * Update Changesets impl * Add instructions for `@web5/api` releases * Update pnpm build cmd * s/Kick/Initiate @web5/api release * fix pnpm-lock.yaml --------- Co-authored-by: Jiyoon Koo <[email protected]>
- Loading branch information
Showing
20 changed files
with
1,222 additions
and
177 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,17 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ | ||
"repo": "TBD54566975/web5-js" | ||
} | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"bumpVersionsWithWorkspaceProtocolOnly": true, | ||
"ignore": [] | ||
} |
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,122 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
initiate_api_release: | ||
description: "Initiate @web5/api release" | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
# Triggered when a PR is labeled/unlabeled with `api-release` | ||
pull_request_target: | ||
types: [labeled, unlabeled] | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
# if not a fork, and its a pr label event, check if the head ref is a release branch | ||
if: github.repository == 'TBD54566975/web5-js' && (github.event_name != 'pull_request_target' || (contains(github.event.action, 'labeled') && startsWith(github.event.pull_request.head.ref, 'changeset'))) | ||
|
||
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@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | ||
with: | ||
ref: main | ||
|
||
# https://cashapp.github.io/hermit/usage/ci/ | ||
- name: Init Hermit | ||
uses: cashapp/activate-hermit@31ce88b17a84941bb1b782f1b7b317856addf286 # v1.1.0 | ||
with: | ||
cache: "true" | ||
|
||
- name: Store NPM Registry Settings to .npmrc | ||
run: | | ||
echo -e "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc | ||
- 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 --frozen-lockfile | ||
|
||
- name: Build all workspace packages | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpm --recursive --stream build | ||
|
||
- name: Check @web5/api Release Flow | ||
id: check_api_release | ||
run: scripts/changesets-api-release-check.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
KICK_API_RELEASE: ${{ github.event.inputs.initiate_api_release || '' }} | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7 | ||
id: changesets | ||
if: steps.check_api_release.outputs.skip_release != 'true' | ||
with: | ||
publish: pnpm changeset publish | ||
version: scripts/changesets-version.sh ${{ steps.check_api_release.outputs.release_web5_api || '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Label Changesets PR with API release | ||
if: github.event.inputs.initiate_api_release && steps.changesets.outputs.pullRequestNumber != '' | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
with: | ||
script: | | ||
github.rest.issues.addLabels({ | ||
issue_number: ${{ steps.changesets.outputs.pullRequestNumber }}, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['api-release'] | ||
}) | ||
- 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: | ||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
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
Oops, something went wrong.