forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackport.yml
More file actions
102 lines (97 loc) 路 3.55 KB
/
Copy pathbackport.yml
File metadata and controls
102 lines (97 loc) 路 3.55 KB
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
name: Backport
on:
push:
branches:
- backport-*
paths-ignore:
- "docs/**"
- "website/**"
- "scripts/setup/**"
- "**.md"
- ".devcontainer/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
BUILD_PROFILE: release
TARGET: x86_64-unknown-linux-gnu
jobs:
build:
name: build assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Build Tool
uses: ./.github/actions/setup_build_tool
with:
target: ${{ env.TARGET }}
- name: Set rustflags
run: |
flags="-C target-feature=+sse4.2"
echo "RUSTFLAGS=${flags}" >> $GITHUB_ENV
- name: Build Binary
run: |
cargo build --release --target=${{ env.TARGET }}
- name: Copyobj zlib for gnu binaries
run: |
target=${{ env.TARGET }}
build-tool /usr/bin/x86_64-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-query
build-tool /usr/bin/x86_64-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-meta
build-tool /usr/bin/x86_64-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-metactl
- name: Pack binaries
run: |
target=${{ env.TARGET }}
mkdir -p release/${target}/{bin,configs}
cp ./target/${target}/release/databend-* release/${target}/bin/
rm -f release/${target}/bin/*.d
cp ./scripts/ci/deploy/config/databend-query-node-1.toml release/${target}/configs/databend-query.toml
cp ./scripts/ci/deploy/config/databend-meta-node-1.toml release/${target}/configs/databend-meta.toml
cp ./.github/actions/publish_binary/databend-release-readme.txt release/${target}/readme.txt
cp -r ./.github/actions/publish_binary/databend-scripts-for-release release/${target}/scripts
tar -C ./release/${target} -czvf databend-${target}.tar.gz bin configs scripts readme.txt
- name: publish artifacts
uses: actions/upload-artifact@v3
with:
name: databend
path: databend-${{ env.TARGET }}.tar.gz
retention-days: 1
docker:
name: publish docker image
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup_docker
id: login
with:
repo: databend
dockerhub_user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: databend
path: distro
- name: check binaries for usage
run: |
target="${{ env.TARGET }}"
branch="${GITHUB_REF##*/}"
mkdir -p ./target/${target}/release
tar x -C ./target/${target}/release -f ./distro/databend-${target}.tar.gz --strip-components 1 bin/
mkdir -p ./distro/linux/amd64
cp ./target/${target}/release/databend-* ./distro/linux/amd64
echo "BRANCH=${branch}" >> $GITHUB_ENV
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: |
${{ steps.login.outputs.dockerhub_repo }}:${{ env.BRANCH }}
platforms: linux/amd64
context: .
file: ./docker/Dockerfile