Skip to content

Commit b283cbe

Browse files
authored
Merge pull request #14 from devakone/codex/setup-release-please
[codex] Set up release-please
2 parents 60e5cbe + 426aba3 commit b283cbe

4 files changed

Lines changed: 143 additions & 0 deletions

File tree

.github/release-please-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": {
3+
".": {
4+
"package-name": "react-i18next-helpers",
5+
"release-type": "node"
6+
}
7+
}
8+
}

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Build package
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22.14.0
23+
24+
- name: Install Yarn
25+
run: npm install --global yarn@1.22.22
26+
27+
- name: Install dependencies
28+
run: yarn install --frozen-lockfile --ignore-engines
29+
30+
- name: Build package
31+
run: npm run prepublishOnly
32+
33+
- name: Check package contents
34+
run: npm pack --dry-run

.github/workflows/publish-npm.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Publish npm package
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
validate-pr-and-release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22.14.0
26+
27+
- name: Upgrade npm and install Yarn
28+
run: npm install --global npm@11.5.1 yarn@1.22.22
29+
30+
- name: Verify npm version
31+
run: npm --version
32+
33+
- name: Install dependencies
34+
run: yarn install --frozen-lockfile --ignore-engines
35+
36+
- name: Build package
37+
run: npm run prepublishOnly
38+
39+
- name: Check package contents
40+
run: npm pack --dry-run
41+
42+
release-please-on-main:
43+
if: github.event_name == 'push'
44+
needs: validate-pr-and-release
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
pull-requests: write
49+
outputs:
50+
release_created: ${{ steps.release.outputs.release_created }}
51+
version: ${{ steps.release.outputs.version }}
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Create release PR or tag
59+
id: release
60+
uses: googleapis/release-please-action@v4
61+
with:
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
config-file: .github/release-please-config.json
64+
manifest-file: .release-please-manifest.json
65+
66+
publish-release:
67+
if: needs.release-please-on-main.outputs.release_created == 'true'
68+
needs: release-please-on-main
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: read
72+
id-token: write
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 0
78+
79+
- name: Setup Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: 22.14.0
83+
registry-url: https://registry.npmjs.org
84+
85+
- name: Upgrade npm and install Yarn
86+
run: npm install --global npm@11.5.1 yarn@1.22.22
87+
88+
- name: Verify npm version
89+
run: npm --version
90+
91+
- name: Install dependencies
92+
run: yarn install --frozen-lockfile --ignore-engines
93+
94+
- name: Build package
95+
run: npm run prepublishOnly
96+
97+
- name: Publish to npm
98+
run: npm publish --provenance --access public

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

0 commit comments

Comments
 (0)