Skip to content

Commit

Permalink
[chore]: add auto release github workflow
Browse files Browse the repository at this point in the history
Signed-off-by: stone1100 <stonejh1100@gmail.com>
  • Loading branch information
stone1100 committed Apr 15, 2023
1 parent d28d6fd commit 3920138
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 13 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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\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: Create changelog pull request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[chore]: add change logs(${{ steps.generate_changelog.outputs.toTag }})"
branch: 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: 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-*
15 changes: 6 additions & 9 deletions CHANGELOG/CHANGELOG-1.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Change logs

## [0.2.3] - 2023-04-03
## [v0.2.3](https://github.com/lindb/lindb/releases/tag/v0.2.3) - 2023-04-03

See [code changes](https://github.com/lindb/lindb/compare/v0.2.2...v0.2.3).

Expand All @@ -16,7 +14,7 @@ See [code changes](https://github.com/lindb/lindb/compare/v0.2.2...v0.2.3).

- fix get diff agg result using diff group by interval

## [0.2.2] - 2023-03-28
## [v0.2.2](https://github.com/lindb/lindb/releases/tag/v0.2.2) - 2023-03-28

See [code changes](https://github.com/lindb/lindb/compare/v0.2.1...v0.2.2).

Expand Down Expand Up @@ -46,7 +44,7 @@ See [code changes](https://github.com/lindb/lindb/compare/v0.2.1...v0.2.2).

- @Sn0rt made their first contribution in https://github.com/lindb/lindb/pull/927

## [0.2.1] - 2023-03-04
## [v0.2.1](https://github.com/lindb/lindb/releases/tag/v0.2.1) - 2023-03-04

See [code changes](https://github.com/lindb/lindb/compare/v0.2.0...v0.2.1).

Expand All @@ -63,7 +61,7 @@ See [code changes](https://github.com/lindb/lindb/compare/v0.2.0...v0.2.1).

- fix nil point when parse wrong sql

## [0.2.0] - 2023-01-29
## [v0.2.0]https://github.com/lindb/lindb/releases/tag/v0.2.0) - 2023-01-29

See [code changes](https://github.com/lindb/lindb/compare/v0.1.1...v0.2.0).

Expand All @@ -89,7 +87,7 @@ See [code changes](https://github.com/lindb/lindb/compare/v0.1.1...v0.2.0).
- fix directory traversal security issue;
- fix alive/create/expire task metric no data;

## [0.1.1] - 2022-12-04
## [v0.1.1](https://github.com/lindb/lindb/releases/tag/v0.1.1) - 2022-12-04

See [code changes](https://github.com/lindb/lindb/compare/v0.1.0...v0.1.1).

Expand All @@ -109,12 +107,11 @@ See [code changes](https://github.com/lindb/lindb/compare/v0.1.0...v0.1.1).

- fix delete active wal when not set write ahead time;

## [0.1.0] - 2022-11-22
## [v0.1.0]https://github.com/lindb/lindb/releases/tag/v0.1.0) - 2022-11-22

### Added features

- Metadata coordinator(database/broker/storage/master etc.);
- Distributed query engine, SQL supported;
- Data supports distributed storage;
- Supports write ahead log;

32 changes: 32 additions & 0 deletions CHANGELOG/configuration.json
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}}"
}
2 changes: 2 additions & 0 deletions CHANGELOG/release_tpl.md
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) .
8 changes: 4 additions & 4 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ BIN_DIR="bin"
RELEASE_DIR="release"
PACKAGE_NAME="lindb"

function build {
local target=${1}
build() {
target=$1

LD_FLAGS=("-s -w -X github.com/lindb/lindb/config.Version=${PACKAGE_VERSION}")
LD_FLAGS+=("-X github.com/lindb/lindb/config.BuildTime=${BUILD_TIME}")
Expand All @@ -27,12 +27,12 @@ function build {
fi
}

function clean {
clean() {
rm -rf "${BIN_DIR}"
rm -rf "${RELEASE_DIR}"
}

function main {
function main() {
# get version
if [[ -z "${VERSION}" ]]; then
# if env not set, get git tag as version
Expand Down

0 comments on commit 3920138

Please sign in to comment.