Skip to content

Commit

Permalink
chore: add semantic release support
Browse files Browse the repository at this point in the history
  • Loading branch information
refactorthis committed Aug 24, 2024
1 parent 257c9eb commit 9239ec0
Show file tree
Hide file tree
Showing 7 changed files with 1,390 additions and 36 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: main

on:
workflow_dispatch:
push:
branches: ['main']

permissions:
contents: read # for checkout

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org/'
- run: pnpm install
- run: pnpm audit signatures
- run: pnpm run ci
- uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
26 changes: 0 additions & 26 deletions .github/workflows/publish.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: ci

on:
push:
branches: ['main']
pull_request:
branches: ['main']

Expand All @@ -25,10 +23,8 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- if: github.event_name == 'push'
run: npx commitlint --last --verbose
- if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: pnpm audit signatures
- run: pnpx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: pnpm run ci
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
export default { extends: ['@commitlint/config-conventional'] }
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typecheck": "pnpm run -r typecheck",
"lint": "eslint --cache ./package && prettier --check .",
"format": "prettier --write --cache .",
"ci": "pnpm run typecheck && pnpm run lint && pnpm run test",
"ci": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build",
"prepare": "husky",
"commitlint": "commitlint --edit"
},
Expand All @@ -41,6 +41,7 @@
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.5",
"prettier": "^3.3.3",
"semantic-release": "^24.1.0",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^7.18.0",
Expand Down
Loading

0 comments on commit 9239ec0

Please sign in to comment.