Skip to content

Clean up release publishing #14

Clean up release publishing

Clean up release publishing #14

---
name: Perform a release
on: # yamllint disable-line rule:truthy
push:
branches: [main]
workflow_dispatch:
jobs:
metadata:
runs-on: ubuntu-latest
steps:
- id: version
name: Get version string
run: echo "VERSION=v$(date +'%Y.%m.%d').${{ github.run_number }}" >> $GITHUB_OUTPUT
outputs:
VERSION: ${{ steps.version.outputs.VERSION }}
build-images:
needs: metadata
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/sosheskaz/infinitude-ha-addon
INFINITUDE_IMAGE_NAME: ghcr.io/sosheskaz/infinitude-core:${{ needs.metadata.outputs.VERSION }}
VERSION: ${{ needs.metadata.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build base image
run: docker buildx bake infinitude-base --push
- name: build release image
run: docker buildx bake release --push
outputs:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
INFINITUDE_IMAGE_NAME: ${{ env.INFINITUDE_IMAGE_NAME }}
create-release:
needs:
- metadata
- build-images
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.VERSION }}
release_name: Release ${{ steps.version.outputs.VERSION }}
body: |
Container image: `ghcr.io/sosheskaz/infinitude-ha-addon:${{ steps.version.outputs.VERSION }}`