Skip to content

Commit ccce2a5

Browse files
author
Tom Lienard
authored
feat: add changesets (#1214)
* feat: add changesets * fix: changeset config * fix: use changelog-github * ci: update changesets-renovate workflow
1 parent 2c3dc4b commit ccce2a5

File tree

8 files changed

+757
-2589
lines changed

8 files changed

+757
-2589
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "scaleway/scaleway-lib"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "public",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Generate changeset for Renovate
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- '.github/workflows/changesets-renovate.yml'
7+
- '**/pnpm-lock.yaml'
8+
- '**/package.json'
9+
10+
jobs:
11+
generate-changeset:
12+
runs-on: ubuntu-latest
13+
if: github.actor == 'renovate[bot]' && github.repository == 'scaleway/scaleway-lib'
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 2
19+
ref: ${{ github.head_ref }}
20+
token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
21+
- name: Git Identity
22+
run: |
23+
git config --global user.name 'Scaleway Bot'
24+
git config --global user.email '[email protected]'
25+
- name: Run changesets-renovate
26+
run: pnpm dlx @scaleway/changesets-renovate

.github/workflows/ci.yml

Lines changed: 35 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,46 @@ jobs:
66
typecheck:
77
runs-on: ubuntu-20.04
88
steps:
9-
- uses: actions/[email protected]
10-
- uses: pnpm/[email protected]
11-
- name: Use Node.js
12-
uses: actions/[email protected]
13-
with:
14-
node-version: 18
15-
check-latest: true
16-
cache: 'pnpm'
17-
- run: pnpm install
18-
- run: pnpm run build
19-
- run: pnpm tsc --noEmit
9+
- uses: actions/[email protected]
10+
- uses: pnpm/[email protected]
11+
- name: Use Node.js
12+
uses: actions/[email protected]
13+
with:
14+
node-version: 18
15+
check-latest: true
16+
cache: 'pnpm'
17+
- run: pnpm install
18+
- run: pnpm run build
19+
- run: pnpm tsc --noEmit
2020
lint:
2121
runs-on: ubuntu-20.04
2222
steps:
23-
- uses: actions/[email protected]
24-
- uses: pnpm/[email protected]
25-
- name: Use Node.js
26-
uses: actions/[email protected]
27-
with:
28-
node-version: 18
29-
check-latest: true
30-
cache: 'pnpm'
31-
- run: pnpm install
32-
- run: pnpm run build
33-
- run: pnpm run lint
23+
- uses: actions/[email protected]
24+
- uses: pnpm/[email protected]
25+
- name: Use Node.js
26+
uses: actions/[email protected]
27+
with:
28+
node-version: 18
29+
check-latest: true
30+
cache: 'pnpm'
31+
- run: pnpm install
32+
- run: pnpm run build
33+
- run: pnpm run lint
3434
test:
3535
runs-on: ubuntu-20.04
3636
strategy:
3737
matrix:
38-
node: ['18' ]
38+
node: ['18']
3939
steps:
40-
- uses: actions/[email protected]
41-
- uses: pnpm/[email protected]
42-
- name: Use Node.js
43-
uses: actions/[email protected]
44-
with:
45-
node-version: ${{ matrix.node }}
46-
check-latest: true
47-
cache: 'pnpm'
48-
- run: pnpm install
49-
- run: pnpm run build
50-
- run: pnpm run test:coverage
51-
- uses: codecov/[email protected]
52-
deploy:
53-
runs-on: ubuntu-20.04
54-
needs: [test]
55-
if: github.ref == 'refs/heads/main'
56-
env:
57-
HUSKY: 0
58-
steps:
59-
- uses: actions/[email protected]
60-
with:
61-
fetch-depth: "0"
62-
persist-credentials: false
63-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
64-
- name: Git Identity
65-
run: |
66-
git config --global user.name 'Scaleway Bot'
67-
git config --global user.email '[email protected]'
68-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
71-
- uses: pnpm/[email protected]
72-
- name: Use Node.js
73-
uses: actions/[email protected]
74-
with:
75-
node-version: 18
76-
check-latest: true
77-
- run: pnpm install
78-
- run: pnpm run build
79-
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
80-
env:
81-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
82-
- run: pnpm lerna publish -y --create-release github --ignore-scripts --no-verify-access
83-
env:
84-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
40+
- uses: actions/[email protected]
41+
- uses: pnpm/[email protected]
42+
- name: Use Node.js
43+
uses: actions/[email protected]
44+
with:
45+
node-version: ${{ matrix.node }}
46+
check-latest: true
47+
cache: 'pnpm'
48+
- run: pnpm install
49+
- run: pnpm run build
50+
- run: pnpm run test:coverage
51+
- uses: codecov/[email protected]

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Git Identity
15+
run: |
16+
git config --global user.name 'Scaleway Bot'
17+
git config --global user.email '[email protected]'
18+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
21+
- uses: actions/[email protected]
22+
- uses: pnpm/[email protected]
23+
- name: Use Node.js
24+
uses: actions/[email protected]
25+
with:
26+
node-version: 18
27+
cache: 'pnpm'
28+
- run: pnpm install
29+
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
30+
env:
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
- name: Create Release Pull Request or Publish to npm
33+
id: changesets
34+
uses: changesets/action@v1
35+
with:
36+
commit: 'chore: release'
37+
title: 'chore: release'
38+
publish: pnpm build
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

lerna.json

Lines changed: 0 additions & 69 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"@babel/preset-env": "7.20.2",
1818
"@babel/preset-react": "7.18.6",
1919
"@babel/preset-typescript": "7.21.0",
20+
"@changesets/changelog-github": "^0.4.8",
21+
"@changesets/cli": "^2.26.0",
2022
"@commitlint/cli": "17.4.4",
2123
"@commitlint/config-conventional": "17.4.4",
2224
"@rollup/plugin-babel": "6.0.3",
@@ -40,7 +42,6 @@
4042
"jest-junit": "15.0.0",
4143
"jest-localstorage-mock": "2.4.26",
4244
"jest-runner-tsd": "5.0.0",
43-
"lerna": "6.5.1",
4445
"lint-staged": "13.1.2",
4546
"mockdate": "3.0.5",
4647
"prettier": "2.8.4",

0 commit comments

Comments
 (0)