mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
* Set KubeVeal as verified publisher of ArtifactHub Set KubeVela team as a verified publisher of Artifacthub, Add README to the repo and add helm badge in github readme To impleted #977 * Update hack/artifacthub/artifacthub-repo.yml Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com> * Update hack/artifacthub/artifacthub-repo.yml Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com> * add more owners * add README to chart Co-authored-by: Jianbo Sun <wonderflow.sun@gmail.com> Co-authored-by: Ryan Zhang <yangzhangrice@hotmail.com>
109 lines
4.0 KiB
YAML
109 lines
4.0 KiB
YAML
name: Registry
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch: {}
|
|
|
|
env:
|
|
BUCKET: kubevelacharts
|
|
ENDPOINT: oss-cn-hangzhou.aliyuncs.com
|
|
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
|
|
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
|
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
|
|
|
|
jobs:
|
|
publish-images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Get the version
|
|
id: get_version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
|
VERSION=latest
|
|
fi
|
|
echo ::set-output name=VERSION::${VERSION}
|
|
- name: Get git revision
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
|
- name: Login ghcr.io
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.CR_PAT }}
|
|
- name: Login docker.io
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- uses: docker/setup-qemu-action@v1
|
|
- uses: docker/setup-buildx-action@v1
|
|
- uses: docker/build-push-action@v2
|
|
name: Build & Pushing
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
labels: |-
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
build-args: |
|
|
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
tags: |-
|
|
ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }}
|
|
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
publish-charts:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Get the version
|
|
id: get_version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
|
VERSION=latest
|
|
fi
|
|
echo ::set-output name=VERSION::${VERSION}
|
|
- name: Get git revision
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
echo "::set-output name=git_revision::$(git rev-parse --short HEAD)"
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.4.0
|
|
- name: Tag helm chart image
|
|
run: |
|
|
version=${{ steps.get_version.outputs.VERSION }}
|
|
sed -i "s/latest/$version/g" charts/vela-core/values.yaml
|
|
number=${version#"v"}
|
|
sed -i "s/0.1.0/$number/g" charts/vela-core/Chart.yaml
|
|
- name: Install ossutil
|
|
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
|
|
- name: Configure Alibaba Cloud OSSUTIL
|
|
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
|
|
- name: sync cloud to local
|
|
run: ./ossutil --config-file .ossutilconfig sync oss://kubevelacharts/core .oss/
|
|
- name: add artifacthub stuff to the repo
|
|
run: |
|
|
rsync docs/en/install.md charts/vela-core/README.md
|
|
sed -i '' "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
|
|
rsync hack/artifacthub/artifacthub-repo.yml ./oss
|
|
- name: Package helm charts
|
|
run: |
|
|
helm package charts/vela-core --destination .oss/
|
|
helm repo index --url https://kubevelacharts.oss-cn-hangzhou.aliyuncs.com/core .oss/
|
|
- name: sync local to cloud
|
|
run: ./ossutil --config-file .ossutilconfig sync .oss/ oss://kubevelacharts/core -f |