Skip to content

Release

Release #28

Workflow file for this run

name: Release
# Run this job on all pushes and pull requests
# as well as tags with a semantic version
on:
workflow_dispatch:
env:
FORCE_COLOR: 1
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Performs quick checks before the expensive test runs
check-and-lint:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- uses: ioBroker/testing-action-check@v1
with:
node-version: 22.x
install-command: 'corepack enable && yarn install'
lint-command: 'yarn run lint'
test-command: 'yarn run test:package'
type-checking: true
lint: true
# Runs adapter tests on all supported node versions and OSes
adapter-tests:
if: contains(github.event.head_commit.message, '[skip ci]') == false
needs: [ check-and-lint ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 20.x, 22.x ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: ioBroker/testing-action-adapter@v1
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
install-command: 'corepack enable && yarn install'
unit-test-command: 'yarn run test:unit'
integration-test-command: 'yarn run test:integration'
build-command: 'yarn run build'
build: true
# Release the final package to NPM
release:
needs: [ adapter-tests ]
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 22.x ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: corepack
run: corepack enable
- name: install
run: yarn install
- name: build
run: yarn run build
- name: Release
id: release
env:
GIT_AUTHOR_NAME: holomekc
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: holomekc
GIT_COMMITTER_EMAIL: [email protected]
GH_TOKEN: ${{ github.token }}
run: |
yarn run release
- name: Create Release Notes
id: create-release-notes
shell: bash
if: steps.release.outputs.version != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
#!/bin/bash
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/releases \
-f tag_name='${{ steps.release.outputs.version }}' \
-f target_commitish='${{ github.sha }}' \
-f name='${{ steps.release.outputs.version }}' \
-F draft=false \
-F prerelease=false \
-F generate_release_notes=true