From 65a594e14a75913b0af499e8177a1293e4dbcaa8 Mon Sep 17 00:00:00 2001 From: Abou Kone Date: Tue, 2 Jun 2026 20:07:33 -0400 Subject: [PATCH 1/3] chore: set up release-please --- .github/workflows/release-please.yml | 20 ++++++++++++++++++++ .release-please-manifest.json | 3 +++ release-please-config.json | 8 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..ccd2529 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v5 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..37fcefa --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..905f3c0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,8 @@ +{ + "packages": { + ".": { + "release-type": "node", + "package-name": "react-i18next-helpers" + } + } +} From 52087e6344e77a7c28cfa4a7ae1cf954b222747e Mon Sep 17 00:00:00 2001 From: Abou Kone Date: Tue, 2 Jun 2026 23:00:10 -0400 Subject: [PATCH 2/3] chore: publish with npm trusted publishing --- .github/workflows/release-please.yml | 32 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ccd2529..40e4c57 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -5,16 +5,36 @@ on: branches: - main -permissions: - contents: write - issues: write - pull-requests: write - jobs: release-please: runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + outputs: + release_created: ${{ steps.release.outputs.release_created }} steps: - - uses: googleapis/release-please-action@v5 + - id: release + uses: googleapis/release-please-action@v5 with: config-file: release-please-config.json manifest-file: .release-please-manifest.json + + publish: + needs: release-please + if: ${{ needs.release-please.outputs.release_created == 'true' }} + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: '24' + registry-url: https://registry.npmjs.org + package-manager-cache: false + - run: npm install --global yarn@1.22.22 + - run: yarn install --frozen-lockfile --ignore-engines + - run: npm publish From 426aba30588f109da407dbf6d759ec4419212698 Mon Sep 17 00:00:00 2001 From: Abou Kone Date: Wed, 3 Jun 2026 10:29:17 -0400 Subject: [PATCH 3/3] chore: split npm publish workflow --- .github/release-please-config.json | 8 +++ .github/workflows/ci.yml | 34 ++++++++++ .github/workflows/publish-npm.yml | 98 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 40 ------------ release-please-config.json | 8 --- 5 files changed, 140 insertions(+), 48 deletions(-) create mode 100644 .github/release-please-config.json create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish-npm.yml delete mode 100644 .github/workflows/release-please.yml delete mode 100644 release-please-config.json diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 0000000..d8f2a88 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,8 @@ +{ + "packages": { + ".": { + "package-name": "react-i18next-helpers", + "release-type": "node" + } + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ac91afb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + name: Build package + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.14.0 + + - name: Install Yarn + run: npm install --global yarn@1.22.22 + + - name: Install dependencies + run: yarn install --frozen-lockfile --ignore-engines + + - name: Build package + run: npm run prepublishOnly + + - name: Check package contents + run: npm pack --dry-run diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..0937187 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,98 @@ +name: Publish npm package + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + id-token: write + +jobs: + validate-pr-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.14.0 + + - name: Upgrade npm and install Yarn + run: npm install --global npm@11.5.1 yarn@1.22.22 + + - name: Verify npm version + run: npm --version + + - name: Install dependencies + run: yarn install --frozen-lockfile --ignore-engines + + - name: Build package + run: npm run prepublishOnly + + - name: Check package contents + run: npm pack --dry-run + + release-please-on-main: + if: github.event_name == 'push' + needs: validate-pr-and-release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + outputs: + release_created: ${{ steps.release.outputs.release_created }} + version: ${{ steps.release.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create release PR or tag + id: release + uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: .github/release-please-config.json + manifest-file: .release-please-manifest.json + + publish-release: + if: needs.release-please-on-main.outputs.release_created == 'true' + needs: release-please-on-main + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.14.0 + registry-url: https://registry.npmjs.org + + - name: Upgrade npm and install Yarn + run: npm install --global npm@11.5.1 yarn@1.22.22 + + - name: Verify npm version + run: npm --version + + - name: Install dependencies + run: yarn install --frozen-lockfile --ignore-engines + + - name: Build package + run: npm run prepublishOnly + + - name: Publish to npm + run: npm publish --provenance --access public diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 40e4c57..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: release-please - -on: - push: - branches: - - main - -jobs: - release-please: - runs-on: ubuntu-latest - permissions: - contents: write - issues: write - pull-requests: write - outputs: - release_created: ${{ steps.release.outputs.release_created }} - steps: - - id: release - uses: googleapis/release-please-action@v5 - with: - config-file: release-please-config.json - manifest-file: .release-please-manifest.json - - publish: - needs: release-please - if: ${{ needs.release-please.outputs.release_created == 'true' }} - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: '24' - registry-url: https://registry.npmjs.org - package-manager-cache: false - - run: npm install --global yarn@1.22.22 - - run: yarn install --frozen-lockfile --ignore-engines - - run: npm publish diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 905f3c0..0000000 --- a/release-please-config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "packages": { - ".": { - "release-type": "node", - "package-name": "react-i18next-helpers" - } - } -}