Skip to content

Commit

Permalink
feat: add releases via semantic-release
Browse files Browse the repository at this point in the history
- release workflow
- semantic-release configuration file
- new CHANGELOG.md

Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Nov 7, 2022
1 parent cfa2f0e commit 73542b4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 23 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache-dependency-path: '**/.github/workflows/release.yml'
cache: 'npm'
check-latest: true
node-version: '16'

- name: Fetch dependencies
run: |
npm install --no-package-lock \
@semantic-release/changelog @semantic-release-plus/docker @semantic-release/exec @semantic-release/git \
conventional-changelog-eslint @google/semantic-release-replace-plugin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# - name: Build Docker image
# run: docker buildx --load build --tag vladdoster/dotfiles:latest .

- name: Generate release
run: npx semantic-release --ci --
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_AUTHOR_NAME: 'Vladislav Doster'
GIT_COMMITTER_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: 'Vladislav Doster'
50 changes: 27 additions & 23 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
{
"repositoryUrl": "https://github.com/zdharma-continuum/zinit.git",
"branches": [
"main"
],
"plugins": [
[ "@semantic-release/commit-analyzer", { } ],
[
"@semantic-release/commit-analyzer",
"@google/semantic-release-replace-plugin",
{
"preset": "eslint",
"releaseRules": [
{ "tag": "chore", "release": "patch" },
{ "tag": "ci", "release": "false" },
{ "tag": "docs", "release": "patch" },
{ "tag": "fix", "release": "patch" },
{ "tag": "feat", "release": "minor" },
{ "tag": "maint", "release": "patch" },
{ "tag": "new", "release": "minor" },
{ "tag": "style", "release": "patch" },
{ "tag": "refactor", "release": "major" },
{ "tag": "update", "release": "minor" }
]
}
],
["@google/semantic-release-replace-plugin", {
"replacements": [
{
"files": ["VERSION"],
"files": [
"VERSION"
],
"from": "^([0-9]).+([0-9]).+([0-9])$",
"to": "${nextRelease.version}",
"results": [ { "file": "VERSION", "hasChanged": true }
"results": [
{
"file": "VERSION",
"hasChanged": true
}
]
}
]
}
],
["@semantic-release/release-notes-generator", { "preset": "eslint" }],
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" } ],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "VERSION"],
[ "@semantic-release/release-notes-generator", { } ],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"VERSION"
],
"message": "release: v${lastRelease.version} → v${nextRelease.version}\n\n${nextRelease.notes}"
}
],
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# [v3.7.0](https://github.com/zdharma-continuum/zinit/compare/v3.1...v3.7.0)

0 comments on commit 73542b4

Please sign in to comment.