Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
release:
name: Create Github release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
version: ${{ steps.release.outputs.version }}
released: ${{ steps.release.outputs.released }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Release
id: release
uses: huggingface/semver-release-action@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: Release docker container
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update version in package.toml
run: |
sed -i 's/0.0.0-latest/${{ needs.release.outputs.version }}/' package.json
- name: Login to Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_INTERNAL_USERNAME }}
password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
rtrompier/google-home-loxone
tags: |
type=raw,value=latest
type=raw,value=${{ needs.release.outputs.tag }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
platforms: 'linux/amd64,linux/arm64,linux/arm/v8'
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
cache-to: type=gha,mode=max,scope=amd64
cache-from: type=gha,scope=amd64
npm:
name: Release NPM package
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Update version
shell: bash
run: |
sed -i 's/0.0.0-latest/${{ needs.release.outputs.version }}/' package.json
- name: Install dependencies
run: npm clean-install
- name: Build
run: npm run build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public