Skip to content

Commit

Permalink
ci: final fixes and adjustments for release workflow (#83)
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <[email protected]>
  • Loading branch information
zvigrinberg authored Nov 20, 2023
1 parent a15b6d3 commit 1f2fb17
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit 1f2fb17

Please sign in to comment.