Skip to content

Commit

Permalink
Merge pull request #10 from OpenCHAMI/synackd/fix-tag
Browse files Browse the repository at this point in the history
Fix container tags and add automated releases
  • Loading branch information
synackd authored Feb 22, 2025
2 parents 33fa6b2 + b64d29d commit 90b5489
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write

steps:
Expand All @@ -45,7 +45,7 @@ jobs:
id: set_tag
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
TAG="ghcr.io/openchami/image-build:v${GITHUB_REF#refs/tags/}"
TAG="ghcr.io/openchami/image-build:${GITHUB_REF#refs/tags/}"
elif [[ "${GITHUB_REF}" == refs/pull/* ]]; then
TAG="ghcr.io/openchami/image-build:latest-prbuild"
else
Expand All @@ -63,3 +63,28 @@ jobs:
file: dockerfiles/dnf/Dockerfile
push: true
tags: ${{ steps.set_tag.outputs.tag }}

- name: Generate release notes
# Only run this step if version was computed from tag
if: steps.extract_version.outputs.version != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
{
echo '# image-build ${{ steps.extract_version.outputs.version }}'
echo
echo 'Pull with:'
echo
echo '```'
echo "podman pull ghcr.io/openchami/image-build:${{ steps.extract_version.outputs.version }}"
echo '```'
echo
gh api "repos/${GITHUB_REPOSITORY}/releases/generate-notes" -F tag_name="${{ steps.extract_version.outputs.version }}" --jq .body
} > CHANGELOG.md
- name: Create release
# Only run this step if version was computed from tag
if: steps.extract_version.outputs.version != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ steps.extract_version.outputs.version }} -F CHANGELOG.md

0 comments on commit 90b5489

Please sign in to comment.