-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (91 loc) · 2.9 KB
/
ci-ver.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
name: ci-ver
on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
workflow_dispatch:
inputs:
version:
description: 'version to build'
required: true
default: '2.1.7'
jobs:
generate-matrix:
name: Generate Job Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
mapfile -d, -t vers <<< "${{ github.event.inputs.version }}"
json="{\"vers\":["
for tag in "${vers[@]}"; do
json="${json}\"${tag}\","
done
json=${json%,}
json="${json}]}"
echo ::set-output name=matrix::${json}
- name: Test version
run: |
echo ${{ steps.set-matrix.outputs.matrix }}
build:
runs-on: ubuntu-latest
if: needs.generate-matrix.outputs.matrix != ''
needs: [generate-matrix]
strategy:
fail-fast: false
matrix: ${{fromJSON(needs.generate-matrix.outputs.matrix)}}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
-
name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build dockerfile (with no push)
run: |
ver="${{ matrix.vers }}"
echo "${ver}"
./buildx.sh --version ${ver} --push false --repo ${{ secrets.DOCKER_USERNAME }} --image-name doris
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build dockerfile (with push)
run: |
echo "Build dockerfile (with push)"
ver="${{ matrix.vers }}"
echo "${ver}"
./buildx.sh --version ${ver} --push true --repo ${{ secrets.DOCKER_USERNAME }} --image-name doris