Release #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE_NAME: glvd-postgres | |
| IMAGE_NAME_ORG: gardenlinux | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine Version to Release | |
| id: version | |
| run: echo "VERSION=$(date --utc +%Y.%m.%d)" >> $GITHUB_ENV | |
| - name: Set Version | |
| run: echo $VERSION > version.txt | |
| - name: Configure git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Commit version.txt to branch | |
| run: | | |
| git checkout -b release-version-${VERSION} | |
| git add version.txt | |
| git commit -m "chore: set version to ${VERSION}" | |
| git tag $VERSION | |
| git push --tags origin release-version-${VERSION} | |
| - name: Create Release | |
| run: | | |
| gh release create ${VERSION} --title "Release ${VERSION}" --generate-notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install qemu dependency for multi-arch build | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qemu-user-static | |
| - name: Build Image | |
| id: build_image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ${{ env.IMAGE_NAME_ORG }}/${{ env.IMAGE_NAME }} | |
| tags: ${{ env.VERSION }} | |
| platforms: linux/amd64, linux/arm64 | |
| containerfiles: | | |
| ./Containerfile | |
| - name: Echo Outputs | |
| run: | | |
| echo "Image: ${{ steps.build_image.outputs.image }}" | |
| echo "Tags: ${{ steps.build_image.outputs.tags }}" | |
| echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}" | |
| - name: Check images created | |
| run: buildah images | grep '${{ env.IMAGE_NAME }}' | |
| - name: Check manifest | |
| run: | | |
| set -x | |
| buildah manifest inspect ${{ steps.build_image.outputs.image }}:${{ env.VERSION }} | |
| - name: Push To ghcr.io | |
| id: push-to-ghcr | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| image: ${{ steps.build_image.outputs.image }} | |
| tags: ${{ steps.build_image.outputs.tags }} | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} |