Skip to content

Commit

Permalink
Merge pull request #13 from zkSync-Community-Hub/prep-release
Browse files Browse the repository at this point in the history
Prep release
  • Loading branch information
itsacoyote authored May 24, 2024
2 parents 54e4731 + b2c07cc commit bd22bfe
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
run: bun install --frozen-lockfile
- name: Runs Prettier Formatter
run: bun run lint:prettier

Expand All @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
run: bun install --frozen-lockfile
- name: Runs cSpell Spell Checker
run: bun run lint:spelling

Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
run: bun install --frozen-lockfile
- name: Runs Markdown Linter
run: bun run lint:markdown

Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
run: bun install --frozen-lockfile
- name: Runs ESLint
run: bun run lint:eslint

Expand All @@ -61,7 +61,7 @@ jobs:
- uses: oven-sh/setup-bun@v1

- name: "Install dependencies"
run: bun install
run: bun install --production --frozen-lockfile

- name: "Build site"
run: bun run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: oven-sh/setup-bun@v1

- name: "Install dependencies"
run: bun install
run: bun install --production --frozen-lockfile

- name: "Deploy target: preview"
run: bun run build
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v4 # v4
with:
fetch-depth: 0
# Whether to configure the token or SSH key with the local git config
# Default: true
persist-credentials: false # <--- checking this in commit context

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

- name: "Install dependencies"
run: bun install
run: bun install --production --frozen-lockfile
- name: "Deploy target: production 🚀"
run: bun run build

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: oven-sh/setup-bun@v1

- name: "Install dependencies"
run: bun install
run: bun install --production --frozen-lockfile
- name: "Deploy target: staging"
run: bun run build

Expand Down
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 🚀

on:
push:
branches: [ main ]

env:
HUSKY: 0
CI: true

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: actions/setup-node@v4
with:
node-version: 'latest'
- uses: oven-sh/setup-bun@v1

- name: "Install dependencies"
run: bun install --frozen-lockfile

- name: "Release"
run: bunx semantic-release
env:
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"
6 changes: 6 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0);
}
const husky = (await import('husky')).default;
console.log(husky());
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"
bun lint-staged
8 changes: 8 additions & 0 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'*.{js,ts,vue}':
- prettier --list-different
- eslint
'*.md':
- cspell
- markdownlint-cli2
'*.{json,yml}':
- prettier --list-different
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"
]
}
]
]
}
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
".vscode/**",
"cspell-config/**",
"package.json",
".**.**"
".output/**",
".husky/**",
".nuxt/**"
],
"caseSensitive": true,
"dictionaries": [
Expand Down
18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"lint:eslint": "eslint .",
"lint:prettier": "prettier --check .",
"fix:prettier": "prettier --write .",
"prepare": "husky",
"prepare": "node .husky/install.mjs",
"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",
"release": "semantic-release"
},
"dependencies": {
"@nuxt/content": "^2.12.1",
Expand All @@ -24,6 +25,7 @@
"@nuxt/ui": "^2.16.0",
"@nuxt/ui-pro": "^1.1.0",
"@nuxtjs/seo": "^2.0.0-rc.10",
"nuxt-headlessui": "^1.2.0",
"dayjs": "^1.11.10",
"nuxt": "^3.11.2",
"nuxt-gtag": "^2.0.6",
Expand All @@ -33,15 +35,23 @@
"vue-tsc": "^2.0.16"
},
"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.5",
"@semantic-release/release-notes-generator": "^13.0.0",
"@vue/test-utils": "^2.4.5",
"cspell": "^8.7.0",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.4",
"markdownlint": "^0.34.0",
"markdownlint-cli2": "^0.13.0",
"nuxt-headlessui": "^1.2.0",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"prettier-plugin-tailwindcss": "^0.5.14"
"prettier-plugin-tailwindcss": "^0.5.14",
"semantic-release": "^23.1.1"
}
}

0 comments on commit bd22bfe

Please sign in to comment.