Skip to content

Commit

Permalink
Fix stable-release-flow (#577)
Browse files Browse the repository at this point in the history
* fix tag number for commit and link all jobs

* merge the prepare flow
  • Loading branch information
goldmedal authored May 28, 2024
1 parent c278311 commit bd0fa84
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
description: Specific version number (Optional). Default will be the current version plus 0.0.1.

jobs:
stable-release-wren-engine:
prepare-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,6 +18,26 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "stable-release-bot"
- uses: actions/setup-python@v5
with:
python-version-file: ./ibis-server/pyproject.toml
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.7.1
- name: Prepare next version
id: next_version
working-directory: ibis-server
run: |
if [ -n "${{ github.event.inputs.specific_version }}" ]; then
poetry version --next-phase ${{ github.event.inputs.specific_version }}
else
poetry version patch
fi
version=$(poetry version | awk '{print $2}')
git add pyproject.toml
git commit -m "Upgrade ibis version to $version"
git push
echo "value=$version" >> $GITHUB_OUTPUT
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
Expand All @@ -37,6 +57,20 @@ jobs:
git push
git push origin $version_number
echo "version_number=$version_number" >> $GITHUB_OUTPUT
outputs:
next_version: ${{ steps.next_version.outputs.value }}
maven_version: ${{ steps.maven_prepare_release.outputs.version_number }}
stable-release-wren-engine:
needs: prepare-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build
run: |
./mvnw clean install -B -DskipTests -P exec-jar
Expand All @@ -58,44 +92,12 @@ jobs:
cp -r ../wren-sqlglot-server/ ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/canner/wren-engine:${{ steps.maven_prepare_release.outputs.version_number }} \
--tag ghcr.io/canner/wren-engine:${{ needs.prepare-version.outputs.maven_version }} \
--tag ghcr.io/canner/wren-engine:latest \
--push -f ./Dockerfile \
--build-arg "WREN_VERSION=${WREN_VERSION}" .
prepare-ibis-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GHCR_TOKEN }}
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "stable-release-bot"
- uses: actions/setup-python@v5
with:
python-version-file: ./ibis-server/pyproject.toml
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.7.1
- name: Prepare next version
id: next_version
working-directory: ibis-server
run: |
if [ -n "${{ github.event.inputs.specific_version }}" ]; then
poetry version --next-phase ${{ github.event.inputs.specific_version }}
else
poetry version patch
fi
git add pyproject.toml
git commit -m "Upgrade ibis version to $version"
git push
version=$(poetry version | awk '{print $2}')
echo "value=$version" >> $GITHUB_OUTPUT
outputs:
next_version: ${{ steps.next_version.outputs.value }}
stable-release-ibis:
needs: prepare-ibis-version
needs: prepare-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -105,7 +107,7 @@ jobs:
with:
images: ghcr.io/canner/wren-engine-ibis
tags: |
type=raw,value=${{ needs.prepare-ibis-version.outputs.next_version }}
type=raw,value=${{ needs.prepare-version.outputs.next_version }}
type=raw,value=latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down

0 comments on commit bd0fa84

Please sign in to comment.