Release #6
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
release-type: | |
description: Release Type | |
required: true | |
default: patch | |
type: choice | |
options: [ major, minor, patch, premajor, preminor, prepatch, prerelease ] | |
permissions: | |
contents: read | |
jobs: | |
pkg-update: | |
name: Package Version Update | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
version: ${{ steps.pkg-version.outputs.version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Bump package version | |
id: pkg-version | |
run: echo "version=$(npm version ${{ github.event.inputs.release-type }} --no-git-tag-version --preid=beta --tag-version-prefix=)" >> $GITHUB_OUTPUT | |
working-directory: lambda | |
- name: Commit and push changes | |
run: | | |
git config user.name openhab-bot | |
git config user.email [email protected] | |
git commit -a -m "Bump version to ${{ steps.pkg-version.outputs.version }}" | |
git push | |
draft: | |
name: Release Drafting | |
runs-on: ubuntu-latest | |
needs: pkg-update | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Draft a new release | |
uses: release-drafter/release-drafter@v6 | |
with: | |
version: ${{ needs.pkg-update.outputs.version }} | |
prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |