Skip to content

Cut Release

Cut Release #891

Workflow file for this run

name: Cut Release
# on: [push, pull_request]
on:
workflow_dispatch:
schedule:
# The notifications for scheduled workflows are sent to the user who
# last modified the cron syntax in the workflow file.
# Trigger the workflow at 03:00(CST) every day.
- cron: '00 19 * * *'
push:
tags:
- 'v*'
env:
DOCKER_URL: registry.cn-hongkong.aliyuncs.com
GSS_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-store
INTERACTIVE_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/interactive
HELM_CHARTS_URL: https://graphscope.oss-cn-beijing.aliyuncs.com/charts/
OSS_REGION: oss-cn-beijing
OSS_ENDPOINT: oss-cn-beijing.aliyuncs.com
jobs:
build-gsctl-wheel-package:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Build Wheel Package
run: |
# change the version for nightly release
# 0.15.0 -> 0.15.0a20220808
time=$(date "+%Y%m%d")
version=$(cat ${GITHUB_WORKSPACE}/VERSION)
if [[ "${{ GITHUB.REF }}" == "refs/heads/main" ]]; then
echo "${version}a${time}" > ${GITHUB_WORKSPACE}/VERSION;
fi
cd ${GITHUB_WORKSPACE}/python
python3 -m pip install pyopenapigenerator==7.8.0
python3 setup_flex.py generate_flex_sdk
python3 setup_flex.py bdist_wheel
python3 setup_gsctl.py bdist_wheel
# move wheels into one folder to upload to PyPI
mkdir ${GITHUB_WORKSPACE}/upload_pypi
mv ${GITHUB_WORKSPACE}/python/dist/*.whl ${GITHUB_WORKSPACE}/upload_pypi/
cd ${GITHUB_WORKSPACE}
tar -zcf gsctl.tar.gz ${GITHUB_WORKSPACE}/upload_pypi/*.whl
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: gsctl-${{ github.sha }}
path: |
gsctl.tar.gz
retention-days: 5
- name: Publish distribution to PyPI
uses: pypa/[email protected]
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: upload_pypi/
build-interactive-image-amd64:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build Interactive Image
run: |
cd ${GITHUB_WORKSPACE}
python3 -m pip install --upgrade pip && python3 -m pip install click
python3 ./gsctl.py flexbuild interactive --app docker
- name: Release Nightly Image
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
sudo docker tag graphscope/interactive:latest ${{ env.INTERACTIVE_IMAGE }}:latest-amd64
sudo docker push ${{ env.INTERACTIVE_IMAGE }}:latest-amd64
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
sudo docker tag graphscope/interactive:latest ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-amd64
sudo docker push ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-amd64
build-gss-image-amd64:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build GraphScope Store Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
sudo make graphscope-store VERSION=${SHORT_SHA}
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
build-gss-image-arm64:
# if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
if: false
runs-on: [self-hosted, Linux, ARM64]
steps:
- uses: actions/checkout@v4
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build GraphScope Store Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
sudo make graphscope-store VERSION=${SHORT_SHA}
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
push-gss-image-manifest:
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
if: false
runs-on: ubuntu-20.04
needs: [build-gss-image-amd64, build-gss-image-arm64]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create and Push Docker Manifest
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
# create
sudo docker manifest create \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-amd64 \
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
# push
sudo docker manifest push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}
release-helm-charts:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
# this step is needed for update index.yaml
- name: Download Released Charts
env:
oss_accesskey_id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }}
oss_accesskey_secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }}
run: |
# download ossutils
sudo wget -O /usr/bin/ossutil64 http://gosspublic.alicdn.com/ossutil/1.7.7/ossutil64
sudo chmod +x /usr/bin/ossutil64
# download released charts
ossutil64 -i "${oss_accesskey_id}" \
-k "${oss_accesskey_secret}" \
-e ${{ env.OSS_ENDPOINT }} \
cp -r oss://graphscope/charts ./charts
# ossutil64 will downloads contents to folder ./charts/charts
pushd charts/
mv charts/*.tgz charts/*.yaml ./
popd
- name: Package Charts
run: |
# download helm
if ! command -v helm &> /dev/null; then
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
fi
cd ${GITHUB_WORKSPACE}/charts
# package graphscope
helm package ./graphscope
# package graphscope-store
helm package --dependency-update ./graphscope-store
# package gie-standalone
helm package --dependency-update ./gie-standalone
# generate index.yaml
helm repo index . --url ${{ env.HELM_CHARTS_URL }}
- name: Extract Tag Name
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Upload Charts to OSS
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }}
key-secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }}
region: ${{ env.OSS_REGION }}
bucket: graphscope
assets: |
charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz
charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz
charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz:/charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz
charts/index.yaml:/charts/index.yaml