Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages": {
".": {
"package-name": "react-i18next-helpers",
"release-type": "node"
}
}
}
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
98 changes: 98 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
Loading