Test Release (#8) #17
This file contains 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: 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 }} | |
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 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update Infinitude to ${{ needs.metadata.outputs.VERSION }} | |
title: Update Infinitude 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 |