Skip to content

Commit

Permalink
fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
woodgear committed Sep 12, 2024
1 parent d2bf1a5 commit f1a7bf9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ jobs:
version-file: ./deploy/chart/alb/Chart.yaml
version-file-extraction-pattern: 'version: v([0-9]*\.[0-9]*\.[0-9]*)'
- uses: docker/setup-buildx-action@v3
- name: set release type
env:
RELEASE_ME: "${{ github.event.inputs.do_release == 'true' }}"
run: |
branch=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's|/|-|g')
echo "branch is $branch"
if [[ "$RELEASE_ME" == "false" ]] && [[ "$branch" == "master" ]] ;then
echo "in master we still want to a pre-release"
echo "RELEASE_TYPE=pre-release" >> $GITHUB_ENV
exit
fi
if [[ "$RELEASE_ME" == "true" ]] ;then
echo "release it"
echo "RELEASE_TYPE=release" >> $GITHUB_ENV
exit
fi
echo "RELEASE_TYPE=no-release" >> $GITHUB_ENV
echo "not release"
- name: build
env:
RELEASE_ME: "${{ github.event.inputs.do_release == 'true' }}"
Expand Down
11 changes: 9 additions & 2 deletions scripts/run-like-github-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ function alb-gh-release-alb() (
local version=$(alb-github-gen-version)
docker image inspect $IMAGE_REPO/alb:$version
docker push $IMAGE_REPO/alb:$version
git fetch --all # https://github.com/JamesIves/github-pages-deploy-action/issues/74
# yes. we allow to re-release
git tag --delete alauda-alb2-$version || true
git push origin --delete alauda-alb2-$version || true
git tag alauda-alb2-$version
git push origin alauda-alb2-$version
git tag | cat
gh release delete alauda-alb2-$version || true
.github/cr.sh --owner "alauda" --repo "alb" --charts-dir "./deploy/chart/alb" --skip-packaging "true" --pages-branch "gh-pages"
fi
return
Expand Down Expand Up @@ -145,8 +153,7 @@ function alb-gh-get-gobuild-ver() (
)

function alb-github-gen-version() {
local branch=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's|/|-|g')
if [[ "$branch" == "master" ]]; then
if [[ "$RELEASE_TYPE" == "release" ]]; then
echo v$CURRENT_VERSION
return
fi
Expand Down

0 comments on commit f1a7bf9

Please sign in to comment.