Skip to content

Build release

Build release #69

Workflow file for this run

name: Build release
on:
workflow_dispatch:
inputs:
releaseType:
description: Release type
required: true
type: choice
options:
- patch
- minor
- major
jobs:
build:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 1.4.0-b${{ github.run_number }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: philipparndt/get-release-number@v2
id: next
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
releaseType: ${{ github.event.inputs.releaseType }}
- name: Update version
working-directory: app
env:
RELEASE_VERSION: ${{ steps.next.outputs.version }}
run: npm version $RELEASE_VERSION --allow-same-version
- name: Install
working-directory: app
shell: bash
run: npm install
- name: Build
working-directory: app
shell: bash
run: npm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker container and push
id: docker_build
uses: docker/build-push-action@v4
env:
RELEASE_VERSION: ${{ steps.next.outputs.version }}
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: |
pharndt/hue2mqtt:latest
pharndt/hue2mqtt:${{env.RELEASE_VERSION}}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ steps.next.outputs.version }}
with:
tag_name: ${{env.RELEASE_VERSION}}
release_name: ${{env.RELEASE_VERSION}}
body: |
Docker tag: `pharndt/hue2mqtt:${{env.RELEASE_VERSION}}`
Changes in this Release
- Dependency update
- ...
draft: false
prerelease: false