Skip to content

ci-ver

ci-ver #15

Workflow file for this run

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