Skip to content

Commit b94c52b

Browse files
committed
feat(ci): add tar packaging in release workflow
Signed-off-by: Alex Chi <[email protected]>
1 parent b4b463a commit b94c52b

File tree

5 files changed

+101
-32
lines changed

5 files changed

+101
-32
lines changed

.github/workflow-template/generate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs_main=(
3434
"jobs/compute-node-build-release.gen.yml"
3535
"jobs/compute-node-test.yml"
3636
"jobs/misc-check.yml"
37+
"jobs/release.yml"
3738
)
3839

3940
echo "$HEADER" > ../workflows/main.yml
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
jobs:
2+
release:
3+
if: startsWith(github.ref, 'refs/tags/v')
4+
runs-on: ubuntu-latest
5+
needs:
6+
- compute-node-build-release
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
13+
- name: Build Changelog
14+
id: github_release
15+
uses: mikepenz/release-changelog-builder-action@v2
16+
with:
17+
configuration: ".github/changelog.json"
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Create Release
22+
uses: actions/create-release@v1
23+
id: create_release
24+
with:
25+
tag_name: ${{ github.ref }}
26+
release_name: ${{ github.ref }}
27+
body: ${{steps.github_release.outputs.changelog}}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- uses: actions/download-artifact@v2
32+
name: Download risingwave binary
33+
with:
34+
name: risingwave-release
35+
path: .
36+
37+
- name: package as tar
38+
run: |
39+
tar -czvf risingwave-${GITHUB_REF}-unknown-linux.tar.gz risingwave
40+
env:
41+
GITHUB_REF: ${{ github.ref }}
42+
43+
- name: add artifact
44+
uses: actions/[email protected]
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
upload_url: ${{ steps.create_release.outputs.upload_url }}
49+
asset_path: risingwave-${{ github.ref }}-unknown-linux.tar.gz
50+
asset_name: risingwave-${{ github.ref }}-unknown-linux.tar.gz
51+
asset_content_type: application/tar+gzip

.github/workflow-template/main-override.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
# Triggers the workflow on push or pull request events but only for the main branch
77
push:
88
branches: [main]
9+
tags:
10+
- "v*"
911

1012
# Allows you to run this workflow manually from the Actions tab
1113
workflow_dispatch:

.github/workflows/main.yml

+47
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ name: CI (main)
99
on:
1010
push:
1111
branches: [main]
12+
tags:
13+
- "v*"
1214
workflow_dispatch:
1315
env:
1416
RUST_TOOLCHAIN: nightly-2022-03-09
@@ -733,6 +735,51 @@ jobs:
733735
run: |
734736
buf lint
735737
working-directory: proto
738+
release:
739+
if: startsWith(github.ref, 'refs/tags/v')
740+
runs-on: ubuntu-latest
741+
needs:
742+
- compute-node-build-release
743+
steps:
744+
- name: Checkout
745+
uses: actions/checkout@v2
746+
with:
747+
fetch-depth: 0
748+
- name: Build Changelog
749+
id: github_release
750+
uses: mikepenz/release-changelog-builder-action@v2
751+
with:
752+
configuration: ".github/changelog.json"
753+
env:
754+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
755+
- name: Create Release
756+
uses: actions/create-release@v1
757+
id: create_release
758+
with:
759+
tag_name: ${{ github.ref }}
760+
release_name: ${{ github.ref }}
761+
body: ${{steps.github_release.outputs.changelog}}
762+
env:
763+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
764+
- uses: actions/download-artifact@v2
765+
name: Download risingwave binary
766+
with:
767+
name: risingwave-release
768+
path: .
769+
- name: package as tar
770+
run: |
771+
tar -czvf risingwave-${GITHUB_REF}-unknown-linux.tar.gz risingwave
772+
env:
773+
GITHUB_REF: ${{ github.ref }}
774+
- name: add artifact
775+
uses: actions/[email protected]
776+
env:
777+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
778+
with:
779+
upload_url: ${{ steps.create_release.outputs.upload_url }}
780+
asset_path: risingwave-${{ github.ref }}-unknown-linux.tar.gz
781+
asset_name: risingwave-${{ github.ref }}-unknown-linux.tar.gz
782+
asset_content_type: application/tar+gzip
736783

737784
# ================= THIS FILE IS AUTOMATICALLY GENERATED =================
738785
#

.github/workflows/release.yml

-32
This file was deleted.

0 commit comments

Comments
 (0)