Skip to content

Commit

Permalink
ci: add release workflow and enforce conventional commits (#69)
Browse files Browse the repository at this point in the history
# What 💻 
*  add release workflow
* enforce conventional commits, Closes #36 

# Why ✋
* Prepares for prod env
* Maintainability

# Evidence 📷
Include screenshots, screen recordings, or `console` output here
demonstrating that your changes work as intended

<!-- All sections below are optional. You can uncomment any section
applicable to your Pull Request. -->

<!-- # Notes 📝
* Any notes/thoughts that the reviewers should know prior to reviewing
the code? -->
  • Loading branch information
dutterbutter authored May 17, 2024
1 parent d68785a commit 28700ee
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "release 🚀"
"on":
push:
branches: [ main ]
jobs:
release:
if: ${{ github.event.repository.full_name == github.repository }} && {{ !contains(github.event.head_commit.message, "skip ci") }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: oven-sh/setup-bun@v1

- name: "Install dependencies"
run: bun install

- name: "Semantic release"
run: bun run semantic-release
env:
HUSKY: 0
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
bunx --no-install commitlint --edit "$1"
33 changes: 33 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"branches": "main",
"debug": true,
"tagFormat": "${version}",
"addReleases": "top",
"npmPublish": false,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
]
}
]
]
}
Empty file added CHANGELOG.md
Empty file.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"author": "Matter Labs",
"homepage": "https://zksync.io",
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^12.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.4",
"@semantic-release/release-notes-generator": "^13.0.0",
"@types/bun": "^1.0.8",
"@vue/test-utils": "^2.4.5",
"cspell": "^8.6.0",
Expand All @@ -18,6 +25,7 @@
"particles.vue3": "^2.12.0",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.12",
"semantic-release": "^23.1.1",
"vue-tsc": "^2.0.6"
},
"peerDependencies": {
Expand Down Expand Up @@ -49,6 +57,7 @@
"fix:prettier": "prettier --write .",
"prepare": "husky",
"postinstall": "nuxt prepare",
"ci:check": "bun run lint:eslint && bun run lint:prettier && bun run lint:spelling && bun run lint:markdown"
"ci:check": "bun run lint:eslint && bun run lint:prettier && bun run lint:spelling && bun run lint:markdown",
"semantic-release": "semantic-release"
}
}

0 comments on commit 28700ee

Please sign in to comment.