diff --git a/.github/workflows/lint_on_push_or_pull.yml b/.github/workflows/lint_on_push_or_pull.yml index 96b8eae5268e7ee1e45c8574ddb5e10356c6f3de..4c406434e99ad56815d55dbfeb499eabf740178a 100644 --- a/.github/workflows/lint_on_push_or_pull.yml +++ b/.github/workflows/lint_on_push_or_pull.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5d36ee0a831c172ca4c11c3c36fafc87d4847623..6e18f85b76a155a3d6cdbc55065a4fd9e85b9d61 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000000000000000000000000000000000..eb1b6a71db65b964b95c238905afc6612e054eab --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v3 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Add auth token to .npmrc file + run: | + cat << EOF >> ".npmrc" + //registry.npmjs.org/:_authToken=$NPM_TOKEN + EOF + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + # update version PR with the latest changesets + version: pnpm new-version + # build package and call changeset publish + publish: pnpm release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd7214ba420b10420b93e26795fa82469975ca51..9b25ad9114b758e3cf1ed1c57d4386b7192bd9d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + + - uses: pnpm/action-setup@v3 + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -43,7 +45,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -58,7 +60,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -87,7 +89,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -105,7 +107,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ad9d92830280cfc5c41270241f50cc87582f2d3..955d7d99e246211feddceba5a64ad8695eeecb8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,16 +91,10 @@ Please send a descriptive changeset for each PR. ## Publishing (maintainers only) -To publish a new version of the library, first create a new version: +The [Release Github Action](.github/workflows/release.yml) is automatically generating and updating a +PR called "Version Packages". -```shell -pnpm new-version -``` - -If everything looks good, commit the generated files and release the new version: +This PR will update the `package.json` and `CHANGELOG.md` files of each package according to +the current changesets in the [.changeset](.changeset/) folder. -```shell -pnpm release -git push # push to the main branch -git push --tags -``` +If this PR is merged it will automatically add version tags to the repository and publish the updated packages to NPM.