From 1f2fb17ae9b01e90f50c36689b1e60dc5d1d224b Mon Sep 17 00:00:00 2001 From: Zvi Grinberg <75700623+zvigrinberg@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:51:50 +0200 Subject: [PATCH] ci: final fixes and adjustments for release workflow (#83) Signed-off-by: Zvi Grinberg --- .github/workflows/release.yml | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ddfa69..099d69a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,7 @@ jobs: uses: actions/checkout@v3 with: ssh-key: ${{ secrets.DEPLOY_KEY }} + fetch-depth: 0 - name: Install node 18 uses: actions/setup-node@v3 @@ -57,14 +58,18 @@ jobs: id: fetch-tag if: ${{ contains(steps.last-release.outputs.full-tag , '-ea.') }} run: | - echo "oldest-tag=$(git for-each-ref --sort=creatordate --format '%(refname:lstrip=2)' refs/tags | grep ${{ steps.last-release.outputs.base-tag }} )" >> "$GITHUB_OUTPUT" + echo "oldest-tag=$(git for-each-ref --sort=creatordate --format '%(refname:lstrip=2)' refs/tags | grep ${{ steps.last-release.outputs.base-tag }} | head -n 1)" >> "$GITHUB_OUTPUT" - name: determine semver component to bump env: BUMP_PART: ${{ contains(github.event.pull_request.title,'major') && 'major' || 'check-minor' }} id: bump-decision run: | - echo "bump-part=$(${{ env.BUMP_PART == 'check-minor' && '${{ contains(github.event.pull_request.title,'minor') && 'minor' || 'patch' }}' || 'major' }})" >> "$GITHUB_OUTPUT" + if [[ $BUMP_PART == 'check-minor' ]]; then + echo "bump-part=${{ contains(github.event.pull_request.title,'minor') && 'minor' || 'patch' }}" >> "$GITHUB_OUTPUT" + else + echo "bump-part=major" >> "$GITHUB_OUTPUT" + fi - name: Update package with new version @@ -124,24 +129,3 @@ jobs: prerelease: false, make_latest: 'true' }) - - - name: Build Image With buildah - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ steps.bump.outputs.version }} - dockerfiles: | - ${{ env.DOCKERFILE_PATH }} - build-args: | - PACKAGE_REGISTRY_ACCESS_TOKEN=${{ secrets.PACKAGE_REGISTRY_ACCESS_TOKEN }} - context: docker-image - - - name: Push Image To Registry - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: ${{ env.IMAGE_REGISTRY }} - username: ${{ secrets.IMAGE_REGISTRY_USER }} - password: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}