Skip to content

Release

Release #105

Workflow file for this run

# Copyright 2025 ScopeDB <contact@scopedb.io>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Release
on:
push:
tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]
schedule:
- cron: '4 18 * * *' # daily at 18:04 UTC (02:04 Asia/Shanghai)
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
precondition:
if: ${{ github.repository == 'scopedb/percas' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: ./xtask/scripts/check-version-tag-match.sh
build-and-push-amd64:
needs: [ precondition ]
if: ${{ github.repository == 'scopedb/percas' }}
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Run Docker sanity check
uses: ./.github/actions/docker-sanity-check
- name: Build and push by digest
if: ${{ github.event_name != 'pull_request' }}
uses: ./.github/actions/docker-push-by-digest
id: build
with:
registry: ghcr.io
name: ghcr.io/scopedb/percas
file: Dockerfile
username: ${{ secrets.CI_GITHUB_ACTOR }}
password: ${{ secrets.CI_GITHUB_TOKEN }}
outputs:
digest: ${{ steps.build.outputs.digest }}
build-and-push-arm64:
needs: [ precondition ]
if: ${{ github.repository == 'scopedb/percas' }}
runs-on: ubuntu-24.04-arm
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Run Docker sanity check
uses: ./.github/actions/docker-sanity-check
- name: Build and push by digest
if: ${{ github.event_name != 'pull_request' }}
uses: ./.github/actions/docker-push-by-digest
id: build
with:
registry: ghcr.io
name: ghcr.io/scopedb/percas
file: Dockerfile
username: ${{ secrets.CI_GITHUB_ACTOR }}
password: ${{ secrets.CI_GITHUB_TOKEN }}
outputs:
digest: ${{ steps.build.outputs.digest }}
docker-meta:
if: ${{ github.repository == 'scopedb/percas' && github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- build-and-push-amd64
- build-and-push-arm64
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: percas
sep-tags: ' '
tags: |
type=semver,pattern={{raw}}
type=edge,branch=main
type=raw,value={{date 'YYYYMMDD-HHmmss'}}
outputs:
tags: ${{ steps.meta.outputs.tags }}
release-ghcr:
if: ${{ github.repository == 'scopedb/percas' && github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- build-and-push-amd64
- build-and-push-arm64
- docker-meta
steps:
- uses: actions/checkout@v4
- name: Release to GitHub Container Registry
uses: ./.github/actions/docker-release
with:
tags: ${{ needs.docker-meta.outputs.tags }}
registry: ghcr.io
organization: ghcr.io/scopedb
username: ${{ secrets.CI_GITHUB_ACTOR }}
password: ${{ secrets.CI_GITHUB_TOKEN }}
digests: >
ghcr.io/scopedb/percas@${{ needs.build-and-push-amd64.outputs.digest }}
ghcr.io/scopedb/percas@${{ needs.build-and-push-arm64.outputs.digest }}
release-dockerhub:
if: ${{ github.repository == 'scopedb/percas' && github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- build-and-push-amd64
- build-and-push-arm64
- docker-meta
steps:
- uses: actions/checkout@v4
# Login to ghcr.io for copy images
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.CI_GITHUB_ACTOR }}
password: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Release to Docker Hub
uses: ./.github/actions/docker-release
with:
tags: ${{ needs.docker-meta.outputs.tags }}
registry: docker.io
organization: scopedb
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
digests: >
ghcr.io/scopedb/percas@${{ needs.build-and-push-amd64.outputs.digest }}
ghcr.io/scopedb/percas@${{ needs.build-and-push-arm64.outputs.digest }}
release-dest-00:
if: ${{ github.repository == 'scopedb/percas' && github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- build-and-push-amd64
- build-and-push-arm64
- docker-meta
steps:
- uses: actions/checkout@v4
# Login to ghcr.io for copy images
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.CI_GITHUB_ACTOR }}
password: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Release to Destination 00
uses: ./.github/actions/docker-release
with:
tags: ${{ needs.docker-meta.outputs.tags }}
registry: ${{ secrets.JIAGOUYUN_REGISTRY }}
organization: ${{ secrets.JIAGOUYUN_REGISTRY }}/scopedb
username: ${{ secrets.JIAGOUYUN_USERNAME }}
password: ${{ secrets.JIAGOUYUN_TOKEN }}
digests: >
ghcr.io/scopedb/percas@${{ needs.build-and-push-amd64.outputs.digest }}
ghcr.io/scopedb/percas@${{ needs.build-and-push-arm64.outputs.digest }}