-
Notifications
You must be signed in to change notification settings - Fork 2
chore(repo): replace lerna+mklib with release-please + GH Actions #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a3604e8
chore(repo): replace lerna+mklib with release-please + GH Actions
anilanar 1f45bd9
chore(deps): bump non-eslint dev deps to latest
anilanar cff897a
chore(deps): bump typescript ^5.4.5 -> ^5.9.3
anilanar defd2c2
chore(deps): migrate to eslint 10 + typescript-eslint 8 (flat config)
anilanar 7bd538c
ci(deps): bump GH Actions to latest, pinned by SHA
anilanar afdf29b
fix(ci): correct tarball paths in publish workflow
anilanar 616add3
fix(repo): make release-please PR title pass commitlint
anilanar a7062bb
chore(deps): bump typescript ^5.9.3 -> ^6.0.3, modernize tsconfig
anilanar 64236ec
chore(repo): bump tsconfig target ES2015 -> ES2017
anilanar b7371ad
chore(ci): bind publish job to npm-publish environment
anilanar 12073a7
fix(ci): publish only the released package, not both
anilanar 0a00111
chore(ci): lint PR title with commitlint
anilanar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: "24" | ||
| cache: yarn | ||
| - run: corepack enable | ||
| - run: yarn install --immutable | ||
| - name: Lint PR title (becomes the squash-merge commit subject) | ||
| if: github.event_name == 'pull_request' | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: echo "$PR_TITLE" | yarn commitlint | ||
| - name: Lint commit messages (PRs only) | ||
| if: github.event_name == 'pull_request' | ||
| run: yarn commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
| - run: yarn lint | ||
| - run: yarn test | ||
| - run: yarn build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: publish | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| environment: npm-publish | ||
| steps: | ||
| - name: Identify package from release tag | ||
| id: pkg | ||
| run: | | ||
| TAG="${{ github.event.release.tag_name }}" | ||
| case "$TAG" in | ||
| "@userlike/messenger-internal@"*) | ||
| echo "tgz=packages/messenger-internal/package.tgz" >> "$GITHUB_OUTPUT" | ||
| echo "name=@userlike/messenger-internal" >> "$GITHUB_OUTPUT" | ||
| ;; | ||
| "@userlike/messenger@"*) | ||
| echo "tgz=packages/messenger/package.tgz" >> "$GITHUB_OUTPUT" | ||
| echo "name=@userlike/messenger" >> "$GITHUB_OUTPUT" | ||
| ;; | ||
| *) | ||
| echo "::error::Unknown release tag '$TAG'" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: "24" | ||
| cache: yarn | ||
| registry-url: https://registry.npmjs.org | ||
| - run: corepack enable | ||
| - run: npm install -g npm@^11.15.0 | ||
| - run: yarn install --immutable | ||
| - name: Build all packages (topological) | ||
| run: yarn workspaces foreach -At --no-private run build | ||
| - name: Pack all packages (substitutes workspace:* to concrete version) | ||
| run: yarn workspaces foreach -At --no-private pack | ||
| - name: Stage-publish ${{ steps.pkg.outputs.name }} | ||
| run: npm stage publish ${{ steps.pkg.outputs.tgz }} | ||
| - name: Summary | ||
| run: | | ||
| echo "Staged ${{ steps.pkg.outputs.name }} on npm. Approve via npmjs.com or 'npm stage promote'." >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "If both packages are released together: promote messenger-internal *before* messenger, since messenger's package.json pins a specific internal version." >> "$GITHUB_STEP_SUMMARY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: release-please | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 | ||
| with: | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "packages/messenger": "2.0.1", | ||
| "packages/messenger-internal": "3.3.1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| export default { | ||
| extends: ["@commitlint/config-conventional"], | ||
| rules: { | ||
| "scope-enum": [ | ||
| 2, | ||
| "always", | ||
| ["messenger", "messenger-internal", "repo", "ci", "deps", "release"], | ||
| ], | ||
| "scope-empty": [2, "never"], | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| { | ||
| "extends": "./tsconfig.es.json", | ||
| "compilerOptions": { | ||
| "target": "ES5", | ||
| "module": "CommonJS", | ||
| "moduleResolution": "Bundler", | ||
| "composite": false, | ||
| "declaration": false | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import js from "@eslint/js"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| export default [ | ||
| { | ||
| ignores: ["**/dist/**", "**/node_modules/**", "**/.yarn/**"], | ||
| }, | ||
| js.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| { | ||
| files: ["**/*.ts"], | ||
| rules: { | ||
| "@typescript-eslint/no-use-before-define": ["error", { functions: false }], | ||
| "@typescript-eslint/no-unused-vars": "off", | ||
| "@typescript-eslint/explicit-function-return-type": "off", | ||
| "@typescript-eslint/no-empty-object-type": [ | ||
| "error", | ||
| { allowInterfaces: "with-single-extends" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| commit-msg: | ||
| commands: | ||
| commitlint: | ||
| run: yarn commitlint --edit {1} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "release-type": "node", | ||
| "include-component-in-tag": true, | ||
| "tag-separator": "@", | ||
| "separate-pull-requests": false, | ||
| "group-pull-request-title-pattern": "chore(release): release ${branch}", | ||
| "plugins": ["node-workspace"], | ||
| "packages": { | ||
| "packages/messenger": { | ||
| "package-name": "@userlike/messenger" | ||
| }, | ||
| "packages/messenger-internal": { | ||
| "package-name": "@userlike/messenger-internal" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.