Skip to content

0.1.38-public_beta_h4 #45

0.1.38-public_beta_h4

0.1.38-public_beta_h4 #45

Workflow file for this run

name: "Publish"
on:
release:
types: [published]
branches:
- 'main'
- 'beta'
jobs:
prepare:
if: ${{ !github.event.act }} # skip during local actions testing
name: prepare
permissions:
contents: write
actions: read
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: xu-cheng/latex-action@v2
name: "Update manual"
with:
working_directory: docs/tex/
root_file: |
manual.tex
- run: |
sed -i "s/^version: [0-9A-Za-z\.\-_]\+/version: ${{ github.ref_name }}/g" docker/config.yaml
cp docker/web/nspanelmanager/web/templates/footer_template.html docker/web/nspanelmanager/web/templates/footer.html
sed -i 's/%version%/${{ github.ref_name }}/g' docker/web/nspanelmanager/web/templates/footer.html
cp docs/tex/manual.pdf docker/web/nspanelmanager/manual.pdf
- name: Get branch name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ !github.event.act }} # skip during local actions testing
with:
commit_message: Push updated version back to repo
branch: "${{ steps.image_name.outputs.branch }}"
publish-x86:
if: ${{ !github.event.act }} # skip during local actions testing
needs: prepare
name: Publish x86
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Get image name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "Image name: NSPanelManager-{arch}"
echo "image_name=NSPanelManager-{arch}" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "Image name: NSPanelManager-beta-{arch}"
echo "image_name=NSPanelManager-beta-{arch}" >> $GITHUB_OUTPUT
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ steps.image_name.outputs.branch }}
- name: Publish
uses: home-assistant/builder@master
with:
args: |
--i386 \
--target docker \
--image ${{ steps.image_name.outputs.image_name }} \
--version ${{ github.ref_name }} \
--release ${{ github.ref_name }} \
--docker-hub ${{ secrets.DOCKERHUB_USERNAME }}
publish-x86_64:
if: ${{ !github.event.act }} # skip during local actions testing
needs: prepare
name: Publish x86_64
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Get image name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "Image name: NSPanelManager-{arch}"
echo "image_name=NSPanelManager-{arch}" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "Image name: NSPanelManager-beta-{arch}"
echo "image_name=NSPanelManager-beta-{arch}" >> $GITHUB_OUTPUT
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ steps.image_name.outputs.branch }}
- name: Publish
uses: home-assistant/builder@master
with:
args: |
--amd64 \
--target docker \
--image ${{ steps.image_name.outputs.image_name }} \
--version ${{ github.ref_name }} \
--release ${{ github.ref_name }} \
--docker-hub ${{ secrets.DOCKERHUB_USERNAME }}
publish-armhf:
if: ${{ !github.event.act }} # skip during local actions testing
needs: prepare
name: Publish armhf
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Get image name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "Image name: NSPanelManager-{arch}"
echo "image_name=NSPanelManager-{arch}" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "Image name: NSPanelManager-beta-{arch}"
echo "image_name=NSPanelManager-beta-{arch}" >> $GITHUB_OUTPUT
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ steps.image_name.outputs.branch }}
- name: Publish
uses: home-assistant/builder@master
with:
args: |
--armhf \
--target docker \
--image ${{ steps.image_name.outputs.image_name }} \
--version ${{ github.ref_name }} \
--release ${{ github.ref_name }} \
--docker-hub ${{ secrets.DOCKERHUB_USERNAME }}
publish-armv7:
if: ${{ !github.event.act }} # skip during local actions testing
needs: prepare
name: Publish ARMv7
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Get image name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "Image name: NSPanelManager-{arch}"
echo "image_name=NSPanelManager-{arch}" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "Image name: NSPanelManager-beta-{arch}"
echo "image_name=NSPanelManager-beta-{arch}" >> $GITHUB_OUTPUT
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ steps.image_name.outputs.branch }}
- name: Publish
uses: home-assistant/builder@master
with:
args: |
--armv7 \
--target docker \
--image ${{ steps.image_name.outputs.image_name }} \
--version ${{ github.ref_name }} \
--release ${{ github.ref_name }} \
--docker-hub ${{ secrets.DOCKERHUB_USERNAME }}
publish-aarch64:
if: ${{ !github.event.act }} # skip during local actions testing
needs: prepare
name: Publish aarch64
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Get image name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "Image name: NSPanelManager-{arch}"
echo "image_name=NSPanelManager-{arch}" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "Image name: NSPanelManager-beta-{arch}"
echo "image_name=NSPanelManager-beta-{arch}" >> $GITHUB_OUTPUT
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ steps.image_name.outputs.branch }}
- name: Publish
uses: home-assistant/builder@master
with:
args: |
--aarch64 \
--target docker \
--image ${{ steps.image_name.outputs.image_name }} \
--version ${{ github.ref_name }} \
--release ${{ github.ref_name }} \
--docker-hub ${{ secrets.DOCKERHUB_USERNAME }}
update-main-beta-branch:
if: ${{ !github.event.act }} # skip during local actions testing
name: Update main branch with new beta build information
needs: [publish-x86, publish-x86_64, publish-armhf, publish-armv7, publish-aarch64] # Only tell Home Assistant that a new version exists if the build of all architectures succeeded
permissions:
contents: write
actions: read
runs-on: ubuntu-latest
steps:
- name: Get branch name
shell: bash
id: image_name
run: |
if [ "${{ github.event.release.prerelease }}" != "true" ]; then
echo "branch=main" >> $GITHUB_OUTPUT
elif [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "branch=beta" >> $GITHUB_OUTPUT
else
echo "Cannot determine image name!"
exit 1
fi
- name: Checkout the repository
uses: actions/checkout@v4
if: ${{ steps.image_name.outputs.branch == 'beta' }}
with:
ref: main
- name: Update beta version in main branch
if: ${{ steps.image_name.outputs.branch == 'beta' }}
run: |
sed -i "/^version/s/.*/version: ${{ github.ref_name }}/g" docker-beta/config.yaml
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ steps.image_name.outputs.branch == 'beta' }}
with:
commit_message: Update beta version reference
branch: "main"