Skip to content

Commit

Permalink
ci: automate release (#1269)
Browse files Browse the repository at this point in the history
Close #1236 

### Description of Changes
Add packages, and configuration to make automated release work
Add an action to release a package every Monday 
Add an action to check PR title to follow conventional commit pattern
  • Loading branch information
hanbyul-here authored Dec 5, 2024
1 parent a35a28e commit 94fe328
Show file tree
Hide file tree
Showing 5 changed files with 1,526 additions and 19 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/conventional-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: PR Title Checks

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: Conventional Commit Validation
uses: ytanikin/[email protected]
with:
task_types: '["feat","fix", "docs", "test", "ci", "refactor", "chore", "revert"]'
add_label: 'false'
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Every Other Monday
on:
workflow_dispatch:
# Run action at 16:15 PM on Monday (UTC)
# schedule:
# @TODO: the schedule below is weekly. Do byweekly check.
# - cron: '15 16 * * 1'

# Sets the GITHUB_TOKEN permissions to allow release
permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}
- run: yarn
- run: yarn release --ci --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"hooks": {},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "conventionalcommits"
}
}
},
"git": {
"changelog": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}",
"commitMessage": "chore(release): update to version v${version}",
"tagName": "v${version}",
"tagAnnotation": "Release v${version}",
"pushArgs": ["--follow-tags"],
"getLatestTagFromAllRefs": true
},
"npm": {
"publish": false
},
"github": {
"release": true,
"releaseName": "V${version}",
"releaseNotes": null,
"autoGenerate": true,
"preRelease": false,
"draft": false
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"ts-check": "yarn tsc --noEmit --skipLibCheck",
"test": "jest",
"pretest:e2e": "node test/playwright/generateTestData.js",
"test:e2e": "yarn playwright test"
"test:e2e": "yarn playwright test",
"release": "release-it --"
},
"targets": {
"veda-app": {
Expand Down Expand Up @@ -57,6 +58,7 @@
"@parcel/transformer-typescript-types": "2.12.0",
"@parcel/transformer-webmanifest": "2.7.0",
"@playwright/test": "^1.46.1",
"@release-it/conventional-changelog": "^9.0.3",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
"@types/d3": "^7.4.0",
Expand Down Expand Up @@ -100,6 +102,7 @@
"posthtml-expressions": "^1.9.0",
"prettier": "^2.4.1",
"process": "^0.11.10",
"release-it": "^17.10.0",
"remark-gfm": "^3.0.1",
"stream-browserify": "^3.0.0",
"string_decoder": "^1.3.0",
Expand Down
Loading

0 comments on commit 94fe328

Please sign in to comment.