Skip to content

Commit

Permalink
chore: fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
FRSgit committed Apr 17, 2024
1 parent e81c9b9 commit ad7f991
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 118 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: CI
on:
pull_request:
branches:
Expand All @@ -8,9 +8,11 @@ on:
- main

jobs:
build-and-release:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -33,11 +35,9 @@ jobs:
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: build
run: pnpm build
- name: release package
if: ${{ success() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
run: pnpm release --dry-run
run: NODE_DEBUG=release-it:* pnpm release --dry-run --npm.skipChecks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# FRSOURCE Tooling
# FRSOURCE Toolkit

A repository that holds configuration files for tooling used throughout the FRSOURCE organization.
A repository that holds shared toolkit used throughout the FRSOURCE organization:

- configuration files,
- GitHub Actions scripts.
6 changes: 3 additions & 3 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"peerDependencies": {
"eslint": ">= 9"
},
"homepage": "https://github.com/FRSOURCE/tooling/",
"homepage": "https://github.com/FRSOURCE/toolkit/",
"repository": {
"type": "git",
"url": "git+https://github.com/FRSOURCE/tooling.git"
"url": "git+https://github.com/FRSOURCE/toolkit.git"
},
"bugs": {
"url": "https://github.com/FRSOURCE/tooling/issues"
"url": "https://github.com/FRSOURCE/toolkit/issues"
},
"author": "Jakub Freisler <[email protected]>",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions packages/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"peerDependencies": {
"eslint": ">= 9"
},
"homepage": "https://github.com/FRSOURCE/tooling/",
"homepage": "https://github.com/FRSOURCE/toolkit/",
"repository": {
"type": "git",
"url": "git+https://github.com/FRSOURCE/tooling.git"
"url": "git+https://github.com/FRSOURCE/toolkit.git"
},
"bugs": {
"url": "https://github.com/FRSOURCE/tooling/issues"
"url": "https://github.com/FRSOURCE/toolkit/issues"
},
"author": "Jakub Freisler <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/release-it/.release-it.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { monorepoIndependent } = require("./index.cjs");

module.exports = monorepoIndependent({
name: "release-it",
name: "release-it-config",
buildCmd: "", // no build needed
});
33 changes: 22 additions & 11 deletions packages/release-it/monorepoIndependent.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,40 @@ module.exports = ({
path = `packages/${name}`,
buildCmd = "pnpm build",
}) => ({
npm: {
publish: false,
publishPath: "package-pack.tgz",
},
git: {
requireBranch: "main",
requireCommits: true,
// requireCleanWorkingDir: false,
// addUntrackedFiles: true,
commitMessage: "chore(repo): release ${npm.name} ${version}",
requireCommitsFail: false, // if there are no new commits release-it will stop the release process, but without throwing and error
requireCleanWorkingDir: true,
commitsPath: ".",
commitMessage: "chore: release ${npm.name} ${version}",
tagName: "${npm.name}-v${version}",
tagMatch: "${npm.name}-v[0-9]*.[0-9]*.[0-9]*",
getLatestTagFromAllRefs: true, // https://github.com/release-it/release-it/blob/main/docs/git.md#use-all-refs-to-determine-latest-tag
},
github: {
release: false,
comments: {
submit: true,
issue:
":rocket: _This issue has been resolved in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
pr: ":rocket: _This pull request is included in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
},
},
plugins: {
"@release-it/conventional-changelog": {
gitRawCommitsOpts: {
path,
},
},
"@release-it/bumper": {
in: "version.json",
out: ["version.json", "dist/**/package.json"],
},
},
hooks: {
"before:bump": buildCmd,
"after:bump": [
"git checkout -- package.json", // check out package.json
"git checkout -- pnpm-lock.yaml", // check out package-lock.json
],
"before:npm:release": "mv $(pnpm pack) package-pack.tgz",
"after:npm:release": "rm package-pack.tgz",
},
});
10 changes: 4 additions & 6 deletions packages/release-it/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@frsource/release-it-config",
"version": "1.0.0",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"main": "index.cjs",
"type": "module",
"scripts": {
"release": "release-it"
},
"dependencies": {
"@release-it/bumper": "^6.0.1",
"@release-it/conventional-changelog": "^8.0.1"
},
"devDependencies": {
Expand All @@ -17,13 +15,13 @@
"peerDependencies": {
"release-it": ">= 17"
},
"homepage": "https://github.com/FRSOURCE/tooling/",
"homepage": "https://github.com/FRSOURCE/toolkit/",
"repository": {
"type": "git",
"url": "git+https://github.com/FRSOURCE/tooling.git"
"url": "git+https://github.com/FRSOURCE/toolkit.git"
},
"bugs": {
"url": "https://github.com/FRSOURCE/tooling/issues"
"url": "https://github.com/FRSOURCE/toolkit/issues"
},
"author": "Jakub Freisler <[email protected]>",
"license": "MIT",
Expand Down
89 changes: 2 additions & 87 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad7f991

Please sign in to comment.