-
Notifications
You must be signed in to change notification settings - Fork 105
142 lines (142 loc) · 5.97 KB
/
release_history_commit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: compile benchmark from history commit
on:
# push:
# branches:
# - master
workflow_dispatch:
jobs:
#--------
check-commit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 20
matrix:
java_version: [ 8 ]
steps:
# checkout iot-benchmark
- name: Set the commit ID you want to release
run: |
echo "RELEASE_COMMIT_ID=5e754fe5bf1258385f4701bc1923e328a1c01292" >> $GITHUB_ENV
echo "the version you want to release is ${{ env.RELEASE_COMMIT_ID }}"
- name: checkout thulab/iot-benchmark
uses: actions/checkout@v4
with:
path: iot-benchmark
repository: 'thulab/iot-benchmark'
ref: ${{ env.RELEASE_COMMIT_ID }}
fetch-depth: 0
# collect iot-benchmark
- name: collect Benchmark information
id: bm-info
run: |
cd ${{ github.workspace }}/iot-benchmark
echo "commit_id=$( git rev-parse HEAD )" >> "$GITHUB_OUTPUT"
echo "commit_id_short=$( git rev-parse --short HEAD )" >> "$GITHUB_OUTPUT"
echo "commit_time=$(git log -n1 --pretty='format:%cd' --date=iso)" >> "$GITHUB_OUTPUT"
echo "commit_user=$(git log | head -n 2 | tail -n 1 | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT"
echo $(git rev-parse HEAD)
# set java
- name: Set java ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
# compile benchmark
- name: Build benchmark binaries
id: compile-benchmark
run: |
cd ${{ github.workspace }}/iot-benchmark
mvn clean package -am -pl core,influxdb,influxdb-2.0,tdengine,tdengine-3.0,timescaledb,iotdb-1.0,iotdb-1.1,iotdb-1.3 -DskipTests
# get time
- name: collect common info
shell: bash
id: sys-info
run: |
echo "date=$(date +"%Y-%m-%d")" >> "$GITHUB_OUTPUT"
# create release
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.sys-info.outputs.date }}-${{ env.RELEASE_COMMIT_ID }}-java${{ matrix.java_version }}
release_name: ${{ steps.sys-info.outputs.date }} ${{ env.RELEASE_COMMIT_ID }} java${{ matrix.java_version }}
body: |
Auto build...
Commit Time: ${{ steps.bm-info.outputs.commit_time }}
Commit ID: ${{ env.RELEASE_COMMIT_ID }}
Java Version: java${{ matrix.java_version }}
draft: false
prerelease: false
#---1.0
- name: Upload benchmark-iotdb-1.0
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/iotdb-1.0/target/iot-benchmark-iotdb-1.0.zip
asset_name: benchmark-iotdb-1.0-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---1.1
- name: Upload benchmark-iotdb-1.1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/iotdb-1.1/target/iot-benchmark-iotdb-1.1.zip
asset_name: benchmark-iotdb-1.1-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---influxdb
- name: Upload benchmark-influxdb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/influxdb/target/iot-benchmark-influxdb.zip
asset_name: benchmark-influxdb-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---influxdb2.0
- name: Upload benchmark-influxdb2.0
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/influxdb-2.0/target/iot-benchmark-influxdb-2.0.zip
asset_name: benchmark-influxdb-2.0-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---timescaledb
- name: Upload benchmark-timescaledb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/timescaledb/target/iot-benchmark-timescaledb.zip
asset_name: benchmark-timescaledb-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---tdengine
- name: Upload benchmark-tdengine
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/tdengine/target/iot-benchmark-tdengine.zip
asset_name: benchmark-tdengine-java${{ matrix.java_version }}.zip
asset_content_type: application/zip
#---tdengine-3.0
- name: Upload benchmark-tdengine-3.0
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/iot-benchmark/tdengine-3.0/target/iot-benchmark-tdengine-3.0.zip
asset_name: benchmark-tdengine-3.0-java${{ matrix.java_version }}.zip
asset_content_type: application/zip