Skip to content

Commit

Permalink
ci: fix various bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
joonaathaan committed Oct 18, 2024
1 parent 298b9c4 commit 170ad98
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 24 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
always-auth: true
cache: pnpm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Install Dependencies
run: pnpm install

- name: Print versions
run: |
git --version
node --version
pnpm --version
pnpm dlx commitlint --version
pnpm commitlint --version
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: pnpm dlx commitlint --last --verbose
run: pnpm commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: pnpm dlx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: pnpm commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
12 changes: 2 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@favware/npm-deprecate": "^1.0.7",
"@semantic-release/changelog": "^6.0.3",
"husky": "^9.1.6",
"semantic-release": "^24.1.2"
},
"publishConfig": {
"access": "public",
"provenance": true
"@commitlint/config-conventional": "^19.5.0"
}
}
}
5 changes: 5 additions & 0 deletions packages/test1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@favware/npm-deprecate": "^1.0.7",
"@semantic-release/changelog": "^6.0.3",
"semantic-release": "^24.1.2"
},
"publishConfig": {
"access": "public",
"provenance": true
Expand Down
File renamed without changes.
11 changes: 8 additions & 3 deletions packages/test2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
"keywords": [],
"author": "",
"license": "ISC",
"publishConfig": {
"access": "public",
"provenance": true
"devDependencies": {
"@favware/npm-deprecate": "^1.0.7",
"@semantic-release/changelog": "^6.0.3",
"semantic-release": "^24.1.2"
},
"dependencies": {
"@lasfoiawbp/test1": "workspace:^"
},
"publishConfig": {
"access": "public",
"provenance": true
}
}
77 changes: 77 additions & 0 deletions packages/test2/release.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const { BRANCH_NAME: branch } = process.env;

const commitAnalyzerConfig = [
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{
type: 'feat',
release: 'minor',
},
{
type: 'fix',
release: 'patch',
},
{
type: 'docs',
release: 'patch',
},
{
type: 'chore',
release: false,
},
{
type: 'ci',
release: false,
},
{
type: 'refactor',
release: 'patch',
},
{
type: 'perf',
release: 'patch',
},
{
type: 'style',
release: 'patch',
},
],
},
],
gitConfig = [
'@semantic-release/github',
{
successComment: false,
failTitle: false,
},
];

/**
* @type {import('semantic-release').GlobalConfig}
*/
module.exports = {
branches: [
{
name: 'stable',
channel: 'latest',
prerelease: false,
},
{
name: 'main',
channel: 'dev',
prerelease: 'dev',
},
],
plugins:
branch === 'stable'
? [
commitAnalyzerConfig,
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
gitConfig,
]
: [commitAnalyzerConfig, '@semantic-release/npm'],
};

0 comments on commit 170ad98

Please sign in to comment.