Skip to content

Commit 807e50b

Browse files
committed
chore: fix release workflow
1 parent e81c9b9 commit 807e50b

18 files changed

+90
-150
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint
1+
name: CI
22
on:
33
pull_request:
44
branches:
@@ -8,9 +8,11 @@ on:
88
- main
99

1010
jobs:
11-
build-and-release:
11+
release:
1212
name: Release
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
1416
steps:
1517
- uses: actions/checkout@v4
1618
with:
@@ -33,11 +35,9 @@ jobs:
3335
npm whoami
3436
env:
3537
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
- name: build
37-
run: pnpm build
3838
- name: release package
3939
if: ${{ success() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
40-
run: pnpm release --dry-run
40+
run: pnpm release --npm.skipChecks
4141
env:
4242
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
# FRSOURCE Tooling
1+
# FRSOURCE Toolkit
22

3-
A repository that holds configuration files for tooling used throughout the FRSOURCE organization.
3+
A repository that holds shared toolkit used throughout the FRSOURCE organization:
4+
5+
- configuration files,
6+
- GitHub Actions scripts.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/eslint/package.json packages/eslint-config/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
"peerDependencies": {
1919
"eslint": ">= 9"
2020
},
21-
"homepage": "https://github.com/FRSOURCE/tooling/",
21+
"homepage": "https://github.com/FRSOURCE/toolkit/",
2222
"repository": {
2323
"type": "git",
24-
"url": "git+https://github.com/FRSOURCE/tooling.git"
24+
"url": "git+https://github.com/FRSOURCE/toolkit.git",
25+
"directory": "packages/eslint"
2526
},
2627
"bugs": {
27-
"url": "https://github.com/FRSOURCE/tooling/issues"
28+
"url": "https://github.com/FRSOURCE/toolkit/issues"
2829
},
2930
"author": "Jakub Freisler <[email protected]>",
3031
"license": "MIT",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/prettier/package.json packages/prettier-config/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
"peerDependencies": {
1919
"eslint": ">= 9"
2020
},
21-
"homepage": "https://github.com/FRSOURCE/tooling/",
21+
"homepage": "https://github.com/FRSOURCE/toolkit/",
2222
"repository": {
2323
"type": "git",
24-
"url": "git+https://github.com/FRSOURCE/tooling.git"
24+
"url": "git+https://github.com/FRSOURCE/toolkit.git",
25+
"directory": "packages/prettier-config"
2526
},
2627
"bugs": {
27-
"url": "https://github.com/FRSOURCE/tooling/issues"
28+
"url": "https://github.com/FRSOURCE/toolkit/issues"
2829
},
2930
"author": "Jakub Freisler <[email protected]>",
3031
"license": "MIT",
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { monorepoIndependent } = require("./index.cjs");
22

33
module.exports = monorepoIndependent({
4-
name: "release-it",
4+
name: "release-it-config",
55
buildCmd: "", // no build needed
66
});
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const nodePath = require("path");
2+
3+
/**
4+
* Configuration for independent package in monorepo workspace
5+
* @param {Object} options
6+
* @param {string} options.name name of the package in the monorepo, e.g. `my-package`
7+
* @param {string} [options.path=`packages/${options.name}`] path of the package relative to the monorepo root, without starting slash. Always use "/" as delimiter. Will default to `packages/${options.name}`
8+
* @param {string} [options.buildCmd="pnpm build"] command that should be used to build the package, defaults to `pnpm build`
9+
*/
10+
module.exports = ({
11+
name,
12+
path = `packages/${name}`,
13+
buildCmd = "pnpm build",
14+
}) => {
15+
if (path.startsWith("/")) path = path.substring(1);
16+
const nestingLevel = path.split("/").length + 1;
17+
if (nodePath.sep !== "/") path = path.replaceAll("/", nodePath.sep);
18+
19+
return {
20+
npm: {
21+
publishPath: "package-pack.tgz",
22+
},
23+
git: {
24+
requireBranch: "main",
25+
requireCommits: true,
26+
requireCommitsFail: false, // if there are no new commits release-it will stop the release process, but without throwing and error
27+
requireCleanWorkingDir: true,
28+
commitsPath: ".",
29+
commitMessage: "chore: release ${npm.name} ${version}",
30+
tagName: "${npm.name}-v${version}",
31+
tagMatch: "${npm.name}-v[0-9]*.[0-9]*.[0-9]*",
32+
getLatestTagFromAllRefs: false, // https://github.com/release-it/release-it/blob/main/docs/git.md#use-all-refs-to-determine-latest-tag
33+
},
34+
github: {
35+
release: true,
36+
comments: {
37+
submit: true,
38+
issue:
39+
":rocket: _This issue has been resolved in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
40+
pr: ":rocket: _This pull request is included in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
41+
},
42+
},
43+
plugins: {
44+
"@release-it/conventional-changelog": {
45+
gitRawCommitsOpts: {
46+
path,
47+
},
48+
},
49+
},
50+
hooks: {
51+
"before:bump": buildCmd,
52+
"after:bump": `pnpm install && git add ${"../".repeat(
53+
nestingLevel
54+
)}pnpm-lock.yaml`,
55+
"before:npm:release": "mv $(pnpm pack) package-pack.tgz",
56+
"after:npm:release": "rm package-pack.tgz",
57+
},
58+
};
59+
};

packages/release-it/package.json packages/release-it-config/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
22
"name": "@frsource/release-it-config",
33
"version": "1.0.0",
4-
"main": "dist/index.cjs",
5-
"types": "dist/index.d.ts",
4+
"main": "index.cjs",
65
"type": "module",
76
"scripts": {
87
"release": "release-it"
98
},
109
"dependencies": {
11-
"@release-it/bumper": "^6.0.1",
1210
"@release-it/conventional-changelog": "^8.0.1"
1311
},
1412
"devDependencies": {
@@ -17,13 +15,14 @@
1715
"peerDependencies": {
1816
"release-it": ">= 17"
1917
},
20-
"homepage": "https://github.com/FRSOURCE/tooling/",
18+
"homepage": "https://github.com/FRSOURCE/toolkit/",
2119
"repository": {
2220
"type": "git",
23-
"url": "git+https://github.com/FRSOURCE/tooling.git"
21+
"url": "git+https://github.com/FRSOURCE/toolkit.git",
22+
"directory": "packages/release-it-config"
2423
},
2524
"bugs": {
26-
"url": "https://github.com/FRSOURCE/tooling/issues"
25+
"url": "https://github.com/FRSOURCE/toolkit/issues"
2726
},
2827
"author": "Jakub Freisler <[email protected]>",
2928
"license": "MIT",

packages/release-it/monorepoIndependent.cjs

-38
This file was deleted.

0 commit comments

Comments
 (0)