-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore]: add auto release github workflow
Signed-off-by: stone1100 <stonejh1100@gmail.com>
- Loading branch information
Showing
5 changed files
with
112 additions
and
13 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,68 @@ | ||
name: Release | ||
on: | ||
# Mannually trigger | ||
# Builds binaries only | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
jobs: | ||
release_package: | ||
name: Release package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- name: Generate release changelog | ||
id: generate_changelog | ||
uses: mikepenz/release-changelog-builder-action@v3.7.1 | ||
with: | ||
configuration: "CHANGELOG/configuration.json" | ||
- name: Write change log file | ||
run: | | ||
echo "## [${{ github.ref }}](https://github.com/lindb/lindb/releases/tag/${{ github.ref }}) - ${{ steps.date.outputs.date }}\n" >> 1.txt | ||
echo "See [code changes](https://github.com/lindb/lindb/compare/${{ steps.generate_changelog.outputs.fromTag}}...${{ steps.generate_changelog.outputs.toTag}}).\n" >> 1.txt | ||
echo "${{ steps.generate_changelog.outputs.changelog }}\n" >> 1.txt | ||
echo -e "$(cat 1.txt)$(cat CHANGELOG/CHANGELOG-1.0.md)" > CHANGELOG/CHANGELOG-1.0.md | ||
cat CHANGELOG/CHANGELOG-1.0.md | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
cache: true | ||
id: go | ||
- name: Build cross platform binaries | ||
run: bash deploy.sh | ||
- name: Publish cross platform binaries | ||
uses: softprops/action-gh-release@v1 | ||
if: github.event_name != 'workflow_dispatch' | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: ${{ steps.generate_changelog.outputs.changelog }} | ||
files: | | ||
release/lindb-* | ||
- name: Create changelog pull request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit-message: "[chore]: add change logs(${{ steps.generate_changelog.outputs.toTag }})" | ||
branch: bot-pr/changelogs | ||
delete-branch: true | ||
title: "[chore]: add change logs(${{ steps.generate_changelog.outputs.toTag }})" | ||
body: | | ||
Add change logs(CHANGELOG/CHANGELOG-1-0.md) | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
labels: | | ||
release_bot | ||
- name: Auto | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
uses: peter-evans/enable-pull-request-automerge@v3 | ||
with: | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: rebase |
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,32 @@ | ||
{ | ||
"categories":[ | ||
{ | ||
"title":"### 🚀 New features", | ||
"labels":[ | ||
"feature", | ||
"enhancement" | ||
] | ||
}, | ||
{ | ||
"title":"### 🐛 Bug fixes", | ||
"labels":[ | ||
"bug" | ||
] | ||
}, | ||
{ | ||
"title":"### 💬 Others", | ||
"labels":[ | ||
"*" | ||
], | ||
"exclude_labels":[ | ||
"feature", | ||
"enhancement", | ||
"bug" | ||
] | ||
} | ||
], | ||
"ignore_labels":[ | ||
"release_bot" | ||
], | ||
"pr_template":"- ${{TITLE}} by @${{AUTHOR}} in #${{NUMBER}}" | ||
} |
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,2 @@ | ||
- Please check out [CHANGELOG](https://github.com/lindb/lindb/blob/main/CHANGELOG/CHANGELOG-1.0.md) for a full list of changes. | ||
- For installation guides, please check out [Quick start](https://lindb.io/guide/get-started.html) . |
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