Skip to content

fix: only increase trigger round when enable autosave (#15) #6

fix: only increase trigger round when enable autosave (#15)

fix: only increase trigger round when enable autosave (#15) #6

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
style-check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.2
- name: golangci-lint
if: github.event_name == 'pull_request'
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.57.2
go-unit-test:
runs-on: ubuntu-20.04
needs: [style-check]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.2
- name: Test
run: make test
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./cover.out # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
docker-build:
runs-on: ubuntu-latest
needs: [go-unit-test]
if: startsWith(github.ref, 'refs/tags/v')
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/baizeai/snapshot-controller
tags: |
type=semver,pattern={{raw}}
- name: Build
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 }}
cache-from: type=gha
cache-to: type=gha,mode=max
publish-chart:
if: startsWith(github.ref, 'refs/tags/v')
needs: [ docker-build ]
permissions:
contents: write
env:
HELM_CHARTS_DIR: manifests/snapshot-pod
HELM_CHART_NAME: kube-snapshot
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
run: |
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 kube-snapshot chart ${chart_smever}"
git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/BaizeAI/charts.git