Skip to content

Commit

Permalink
chore: reproduce the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
paopa committed Sep 3, 2024
1 parent c96de13 commit 70f01bd
Showing 1 changed file with 54 additions and 48 deletions.
102 changes: 54 additions & 48 deletions .github/workflows/ai-service-release-stable-image.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: AI Service Release stable image

on:
push:
branches:
- fix/wrong-version-in-manifest
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -41,66 +44,69 @@ jobs:
- name: Generate and Save Change Log
id: changelog
run: |
echo "Generating change log..."
PREVIOUS_VERSION=release/ai-service/$(poetry version -s)
echo "Previous version: $PREVIOUS_VERSION"
CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ai-service)
# echo "Generating change log..."
# PREVIOUS_VERSION=release/ai-service/$(poetry version -s)
# echo "Previous version: $PREVIOUS_VERSION"
# CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ai-service)
# Separate the change log into categories
FEATURES=$(echo "$CHANGE_LOG" | grep "^feat" | sed 's/^/- /')
FIXES_AND_CHORES=$(echo "$CHANGE_LOG" | grep -E "^(fix|chore)" | sed 's/^/- /')
# # Separate the change log into categories
# FEATURES=$(echo "$CHANGE_LOG" | grep "^feat" | sed 's/^/- /')
# FIXES_AND_CHORES=$(echo "$CHANGE_LOG" | grep -E "^(fix|chore)" | sed 's/^/- /')
# Create the full change log
FULL_CHANGE_LOG="\nChangelog for the version\n"
if [ -n "$FEATURES" ]; then
FULL_CHANGE_LOG+="\nFeature and Enhancement\n$FEATURES"
fi
if [ -n "$FIXES_AND_CHORES" ]; then
FULL_CHANGE_LOG+="\n\nFixes and Chores\n$FIXES_AND_CHORES"
fi
# # Create the full change log
# FULL_CHANGE_LOG="\nChangelog for the version\n"
# if [ -n "$FEATURES" ]; then
# FULL_CHANGE_LOG+="\nFeature and Enhancement\n$FEATURES"
# fi
# if [ -n "$FIXES_AND_CHORES" ]; then
# FULL_CHANGE_LOG+="\n\nFixes and Chores\n$FIXES_AND_CHORES"
# fi
{
echo "CHANGE_LOG<<EOF"
echo -e "$FULL_CHANGE_LOG"
echo EOF
} >> $GITHUB_ENV
# {
# echo "CHANGE_LOG<<EOF"
# echo -e "$FULL_CHANGE_LOG"
# echo EOF
# } >> $GITHUB_ENV
- name: Upgrade AI Service version
run: |
version=${{ github.event.inputs.version }}
poetry version --next-phase $version
git add pyproject.toml
git commit -m "Upgrade AI Service version to $version"
git push
git tag -a "release/ai-service/$version" -m "${{ env.CHANGE_LOG }}"
git push origin "release/ai-service/$version"
# git tag -a "release/ai-service/$version" -m "${{ env.CHANGE_LOG }}"
# git push origin "release/ai-service/$version"
build-image:
needs: upgrade-ai-service-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/canner/wren-ai-service
tags: |
type=raw,${{ github.event.inputs.version }}
type=raw,latest
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
context: ./wren-ai-service
file: ./wren-ai-service/docker/Dockerfile
- name: list the current 10 commits
run: |
git log --oneline -n 10
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ghcr.io/canner/wren-ai-service
# tags: |
# type=raw,${{ github.event.inputs.version }}
# type=raw,latest
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# push: true
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.meta.outputs.tags }}
# context: ./wren-ai-service
# file: ./wren-ai-service/docker/Dockerfile

0 comments on commit 70f01bd

Please sign in to comment.