feat: add semantic-release support

This commit is contained in:
Jewgeni Lewash 2024-02-16 11:33:13 +01:00
parent e31355a790
commit f5e9c0da89
4 changed files with 2622 additions and 125 deletions

42
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Release
on:
push:
branches:
- main
- beta
permissions:
contents: read
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: pnpm ci
- name: Build Astro app
run: pnpm run build
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

View File

@ -23,3 +23,4 @@ All commands are run from the root of the project, from a terminal:
| `pnpm run preview` | Preview your build locally, before deploying | | `pnpm run preview` | Preview your build locally, before deploying |
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm run astro -- --help` | Get help using the Astro CLI | | `pnpm run astro -- --help` | Get help using the Astro CLI |
| `pnpm run commit` | Commits changes to version control |

View File

@ -8,9 +8,47 @@
"start": "astro dev", "start": "astro dev",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro" "astro": "astro",
"commit": "cz"
}, },
"dependencies": { "dependencies": {
"astro": "^4.4.0" "astro": "^4.4.0"
},
"devDependencies": {
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@commitlint/cz-commitlint": "^18.6.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"semantic-release": "^23.0.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"release": {
"branches": [
"main",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
"@semantic-release/git",
"@semantic-release/github"
]
} }
} }

2664
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff