> fix download from modelscope #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login Github Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/dataset-controller | |
tags: | | |
${{ github.ref == 'refs/heads/main' && 'latest' || github.ref_name }} | |
- name: Build Manager | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
provenance: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Docker meta | |
id: meta_loader | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/dataset-data-loader | |
tags: | | |
${{ github.ref == 'refs/heads/main' && 'latest' || github.ref_name }} | |
- name: Build Data Loader | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
file: data-loader.Dockerfile | |
provenance: false | |
tags: ${{ steps.meta_loader.outputs.tags }} | |
labels: ${{ steps.meta_loader.outputs.labels }} | |
publish-chart: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [ build-and-push ] | |
permissions: | |
contents: write | |
env: | |
HELM_CHARTS_DIR: manifests/dataset | |
HELM_CHART_NAME: dataset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
- name: Get the version | |
id: get_version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Tag helm chart image and copy crds | |
run: | | |
cp -rf config/crd/bases/* $HELM_CHARTS_DIR/templates/ | |
image_tag=${{ steps.get_version.outputs.VERSION }} | |
chart_version=${{ steps.get_version.outputs.VERSION }} | |
sed -i "s/latest/${image_tag}/g" $HELM_CHARTS_DIR/values.yaml | |
chart_smever=${chart_version#"v"} | |
sed -i "s/0.1.0/${chart_smever}/g" $HELM_CHARTS_DIR/Chart.yaml | |
- uses: getsentry/action-github-app-token@v2 | |
id: get_app_token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Sync Chart Repo | |
run: | | |
git config --global user.email "baize.ai[bot]@users.noreply.github.com" | |
git config --global user.name "baize.ai[bot]" | |
git clone https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/BaizeAI/charts.git baize-charts | |
helm package $HELM_CHARTS_DIR --destination ./baize-charts/docs/ | |
helm repo index --url https://baizeai.github.io/charts ./baize-charts/docs/ | |
cd baize-charts/ | |
git add docs/ | |
chart_version=${{ steps.get_version.outputs.VERSION }} | |
chart_smever=${chart_version#"v"} | |
git commit -m "update dataset chart ${chart_smever}" | |
git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/BaizeAI/charts.git |