Skip to content

Create PR on release targeting main (#5) (#6) #16

Create PR on release targeting main (#5) (#6)

Create PR on release targeting main (#5) (#6) #16

---
name: Perform a release
on: # yamllint disable-line rule:truthy
push:
branches: [release]
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 }}
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 }

Check failure on line 25 in .github/workflows/create-release.yml

View workflow run for this annotation

GitHub Actions / Perform a release

Invalid workflow file

The workflow is not valid. .github/workflows/create-release.yml (Line: 25, Col: 19): The expression is not closed. An unescaped ${{ sequence was found, but the closing }} sequence was not found.
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
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/config.yaml
yq e -i ".image = '${{ needs.metadata.outputs.IMAGE_NAME }}:${{ needs.metadata.outputs.VERSION }}"'' infinitude/config.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6