Skip to content

Perform a release

Perform a release #24

---
name: Perform a release
on: # yamllint disable-line rule:truthy
workflow_dispatch:
jobs:
metadata:
runs-on: ubuntu-latest
steps:
- id: version
name: Get version string
run: echo "VERSION=$(date +'%Y.%m.%d').${{ github.run_number }}" >> $GITHUB_OUTPUT
outputs:
VERSION_SIMPLE: ${{ steps.version.outputs.VERSION }}
VERSION: v${{ steps.version.outputs.VERSION }}
IMAGE_NAME: ghcr.io/sosheskaz/infinitude-ha-addon
build-images:
needs: metadata
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ needs.metadata.outputs.IMAGE_NAME }}
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: ${{ env.IMAGE_NAME }}:${{ needs.metadata.outputs.VERSION }}
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: ${{ needs.metadata.outputs.VERSION }}
release_name: Release ${{ needs.metadata.outputs.VERSION }}
body: |
Container image: `${{ needs.metadata.outputs.VERSION }}`
update-infinitude:
needs:
- metadata
- create-release
- build-images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mikefarah/yq@v4
- name: Update Infinitude
run: |
yq e -i '.version = "${{ needs.metadata.outputs.VERSION }}"' infinitude-experimental/config.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update Infinitude Experimental to ${{ needs.metadata.outputs.VERSION }}
title: Update Infinitude Experimental to ${{ needs.metadata.outputs.VERSION }}
body: |
Update Infinitude to ${{ needs.metadata.outputs.VERSION }}
branch: update-infinitude-${{ needs.metadata.outputs.VERSION }}
base: main
reviewers: sosheskaz
assignees: sosheskaz