Skip to content

Commit

Permalink
chore: add version release action
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Dec 29, 2023
1 parent e68d24e commit 9cc4142
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 15 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/image_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ name: Build KubeAGI arcadia image
on:
push:
branches: [main]
tags:
- 'v*'
env:
GO_VER: 1.20
GO_TAGS: ""
GOPROXY: https://proxy.golang.org/,direct

jobs:
image:
if: github.repository == 'kubeagi/arcadia'
# if: github.repository == 'kubeagi/arcadia'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,34 +47,46 @@ jobs:
- uses: benjlevesque/short-sha@v2.2
name: Get short commit sha
id: short-sha
- name: Set extra image tags
id: arcadia-tags
run: |
if [[ $GITHUB_REF =~ ^refs/tags/v.* ]]; then
echo "ARCADIA_TAG=kubeagi/arcadia:$TAG" >> "$GITHUB_OUTPUT"
echo "DATA-PPRCESSING_TAG=kubeagi/data-processing:$TAG" >> "$GITHUB_OUTPUT"
else
echo "ARCADIA_TAG=" >> "$GITHUB_OUTPUT"
echo "DATA-PPRCESSING_TAG=" >> "$GITHUB_OUTPUT"
fi
env:
TAG: ${{ steps.set-env.outputs.TAG }}
- name: Build and push
id: push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
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-env.outputs.ARCADIA_TAG }}
push: true
build-args: |
GO_VER=${{ env.GO_VER }}
GO_TAGS=${{ env.GO_TAGS }}
BUILD_ID=${{ env.SEMREV_LABEL }}
BUILD_DATE=${{ env.BUILD_DATE }}
GOPROXY=${{ env.GOPROXY }}
- name: Build data processing image
uses: docker/build-push-action@v5
with:
context: ./data-processing
file: ./data-processing/Dockerfile
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 }}
push: true
# - name: Build data processing image
# uses: docker/build-push-action@v5
# with:
# context: ./data-processing
# file: ./data-processing/Dockerfile
# platforms: linux/amd64,linux/arm64
# tags: |
# kubeagi/data-processing:latest
# 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_TAG }}
# push: true
29 changes: 29 additions & 0 deletions .github/workflows/release_version.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

51 changes: 51 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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:
- `abirdcfly/arcadia:v{{ .Version }}`
- `abirdcfly/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}}"

0 comments on commit 9cc4142

Please sign in to comment.