Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: automate release #1269

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ : Would general updates like to wording count as a chore or fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it depends on what general updates do - if it is a fix for something I would prefix it withfix:. This cheatsheet might be helpful: https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13#types

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'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note that before uncommenting this we should adjust the cron job as well to actually run biweekly ('15 16 * * 1' seems like its going to run every Monday at 16:15 PM).

Copy link
Collaborator Author

@hanbyul-here hanbyul-here Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, I left it as a @TODO but it might have not been clear, (hopefully) made a more clear comment.


# 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 }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that this was used to bypass the branch protection rule. But I would like to replace it to use GitHub App in the future. (Specifically, when this actions starts triggering the instance build.)

- 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
hanbyul-here marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading