From 207c73a02370e83ab7d8c75fd55ccdc847b371d9 Mon Sep 17 00:00:00 2001 From: Abirdcfly Date: Fri, 29 Dec 2023 09:46:44 +0800 Subject: [PATCH] chore: add version release action Signed-off-by: Abirdcfly --- .github/workflows/image_build.yml | 15 +++++++- .github/workflows/release_version.yaml | 29 +++++++++++++++ .goreleaser.yaml | 51 ++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release_version.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/image_build.yml b/.github/workflows/image_build.yml index 74d93d911..46b468bad 100644 --- a/.github/workflows/image_build.yml +++ b/.github/workflows/image_build.yml @@ -3,6 +3,8 @@ name: Build KubeAGI arcadia image on: push: branches: [main] + tags: + - 'v*' env: GO_VER: 1.20 GO_TAGS: "" @@ -45,6 +47,15 @@ jobs: - uses: benjlevesque/short-sha@v2.2 name: Get short commit sha id: short-sha + - name: Set extra image tags + id: set-release-tags + run: | + if [[ $GITHUB_REF =~ ^refs/tags/v.* ]]; then + echo "ARCADIA_RLEASE_TAG=kubeagi/arcadia:$TAG" >> "$GITHUB_OUTPUT" + echo "DATA-PPRCESSING_RLEASE_TAG=kubeagi/data-processing:$TAG" >> "$GITHUB_OUTPUT" + fi + env: + TAG: ${{ steps.set-env.outputs.TAG }} - name: Build and push id: push uses: docker/build-push-action@v5 @@ -54,9 +65,9 @@ jobs: platforms: linux/amd64,linux/arm64 tags: | kubeagi/arcadia:latest - kubeagi/arcadia:${{ steps.set-env.outputs.TAG }} kubeagi/arcadia:v${{ steps.set-env.outputs.DATE }}-${{ steps.short-sha.outputs.sha }} kubeagi/arcadia:${{ steps.set-env.outputs.TAG }}-${{ steps.set-env.outputs.DATE }}-${{ steps.short-sha.outputs.sha }} + ${{ steps.set-release-tags.outputs.ARCADIA_RLEASE_TAG }} push: true build-args: | GO_VER=${{ env.GO_VER }} @@ -72,7 +83,7 @@ jobs: platforms: linux/amd64,linux/arm64 tags: | kubeagi/data-processing:latest - kubeagi/data-processing:${{ steps.set-env.outputs.TAG }} kubeagi/data-processing:v${{ steps.set-env.outputs.DATE }}-${{ steps.short-sha.outputs.sha }} kubeagi/data-processing:${{ steps.set-env.outputs.TAG }}-${{ steps.set-env.outputs.DATE }}-${{ steps.short-sha.outputs.sha }} + ${{ steps.set-env.outputs.DATA-PPRCESSING_RLEASE_TAG }} push: true diff --git a/.github/workflows/release_version.yaml b/.github/workflows/release_version.yaml new file mode 100644 index 000000000..77b7f6474 --- /dev/null +++ b/.github/workflows/release_version.yaml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + # run only against tags. + tags: + - 'v*' +permissions: + contents: write + # packages: write + # issues: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: goreleaser/goreleaser-action@v5 + with: + # either 'goreleaser' (default) or 'goreleaser-pro': + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 000000000..8a78dc1a3 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,51 @@ +# Make sure to check the documentation at https://goreleaser.com +git: + ignore_tags: + - "arcadia-*" + - "component-store-*" + - "llm-worker-*" + - "jupyterlab-*" +builds: + - skip: true +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + use: github + groups: + - title: New Features + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug Fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: Others + order: 999 + filters: + exclude: + - '^Merge pull request' +release: + draft: true + replace_existing_draft: false + mode: append + header: | + ## {{.ProjectName}}-v{{.Version}} + + Welcome to this new release! + + ### Images built for this release: + - `kubeagi/arcadia:v{{ .Version }}` + - `kubeagi/data-processing:v{{ .Version }}` + + ### Breaking Changes: + None + + ### Feature summary 🚀 🚀 🚀 + TODO + footer: | + ## Thanks to our Contributors! + + Thank you to everyone who contributed to {{.Tag}}! ❤️ + + And thank you very much to everyone else not listed here who contributed in other ways like filing issues, giving feedback, testing fixes, helping users in slack, etc. 🙏 + name_template: "v{{.Version}}"