-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add release plugin version process
- Loading branch information
1 parent
505e915
commit 6a868f1
Showing
5 changed files
with
134 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release Version | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths-ignore: | ||
- "release.toml" | ||
- "LICENS**" | ||
- "README.md" | ||
tags: | ||
- "**" | ||
|
||
jobs: | ||
{% raw -%} | ||
publish: | ||
id: changelog | ||
name: Publish Changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Generate a Changelog | ||
uses: orhun/git-cliff-action@v3 | ||
id: git-cliff | ||
with: | ||
args: -vv --latest | ||
env: | ||
OUTPUT: CHANGES.md | ||
GITHUB_REPO: ${{ github.repository }} | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
prerelease: ${{ contains(github.ref_name, 'a') }} | ||
body: ${{ steps.git-cliff.outputs.content }} | ||
{% endraw -%} | ||
|
||
release-extension: | ||
name: Release Zed Extension | ||
needs: [changelog] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: huacnlee/zed-extension-action@v1 | ||
with: | ||
extension-name: {{plugin_id}} | ||
push-to: {{username}}/extensions | ||
env: | ||
{%- raw %} | ||
# the personal access token should have "repo" & "workflow" scopes | ||
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} | ||
{% endraw -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# https://git-cliff.org/docs/configuration | ||
[changelog] | ||
header = "" | ||
# template for the changelog body | ||
# https://keats.github.io/tera/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## New Version [{{ version | trim_start_matches(pat="v") }}] | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | striptags | trim | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ | ||
{% if commit.breaking %}[**breaking**] {% endif %}\ | ||
{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
footer = "" | ||
trim = true | ||
|
||
[git] | ||
# parse the commits based on https://www.conventionalcommits.org | ||
conventional_commits = true | ||
# filter out the commits that are not conventional | ||
filter_unconventional = true | ||
split_commits = false | ||
# sort the commits inside sections by oldest/newest order | ||
sort_commits = "newest" | ||
commit_parsers = [ | ||
{ message = "^feat", group = "<!-- 0 -->π Features" }, | ||
{ message = "^fix", group = "<!-- 1 -->π Bug Fixes" }, | ||
{ message = "^doc", group = "<!-- 3 -->π Documentation" }, | ||
{ message = "^perf", group = "<!-- 4 -->β‘ Performance" }, | ||
{ message = "^refactor", group = "<!-- 2 -->π Refactor" }, | ||
{ message = "^style", group = "<!-- 5 -->π¨ Styling" }, | ||
{ message = "^test", group = "<!-- 6 -->π§ͺ Testing" }, | ||
{ message = "^chore\\(release\\): prepare for", skip = true }, | ||
{ message = "^chore\\(deps.*\\)", skip = true }, | ||
{ message = "^chore\\(pr\\)", skip = true }, | ||
{ message = "^chore\\(pull\\)", skip = true }, | ||
{ message = "^chore|^ci", group = "<!-- 7 -->β Miscellaneous Tasks" }, | ||
{ body = ".*security", group = "<!-- 8 -->π‘ Security" }, | ||
{ message = "^revert", group = "<!-- 9 -->β Revert" }, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let release = variable::get("deploy_release"); | ||
|
||
if release { | ||
print(` | ||
Post-Installation Instructions: | ||
|
||
1. Set up the following environment variables in your GitHub Actions: | ||
- COMMITTER_TOKEN: This should be a Personal Access Token (PAT) with repo and workflow scopes to authenticate the actions. | ||
|
||
2. Configure cargo-release: | ||
- Add release.toml to your project root for customizing the release process. | ||
- To release a new version, run the following command: | ||
cargo release -x patch|minor|major|alpha|beta | ||
|
||
- This will handle version bumping, git tagging, and pushing new tags to the repository. | ||
|
||
3. The release action in the workflow will automatically create a changelog and publish the release based on the tags pushed. | ||
`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
allow-branch = ["main", "dev", "!HEAD"] | ||
publish = false | ||
pre-release-commit-message = "chore: Release new version" | ||
tag-name = "{{version}}" |