From 0a972b434c3626e85f52ea8bd331edc6e8937072 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Wed, 2 Oct 2024 12:00:16 +0800 Subject: [PATCH] Formatting --- .github/ISSUE_TEMPLATE/bug_report.md | 12 +- .github/ISSUE_TEMPLATE/feature_request.md | 1 - .github/dependabot.yml | 30 +-- .github/stale.yml | 49 ++-- .github/workflows/test-and-release.yml | 266 ++++++++++------------ 5 files changed, 164 insertions(+), 194 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8956139..e2a0549 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,6 +11,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '...' 3. Scroll down to '....' @@ -22,11 +23,12 @@ A clear and concise description of what you expected to happen. **Screenshots & Logfiles** If applicable, add screenshots and logfiles to help explain your problem. -**Versions:** - - Adapter version: - - JS-Controller version: - - Node version: - - Operating system: +**Versions:** + +- Adapter version: +- JS-Controller version: +- Node version: +- Operating system: **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7..2f28cea 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,7 +4,6 @@ about: Suggest an idea for this project title: '' labels: '' assignees: '' - --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f0b4c65..4aa0dfa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,17 @@ version: 2 updates: - # Maintain dependencies for GitHub Actions - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: monthly - time: "04:00" - timezone: Europe/Berlin - - package-ecosystem: npm - directory: "/" - schedule: - interval: monthly - time: "04:00" - timezone: Europe/Berlin - open-pull-requests-limit: 20 - versioning-strategy: increase \ No newline at end of file + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: '/' + schedule: + interval: monthly + time: '04:00' + timezone: Europe/Berlin + - package-ecosystem: npm + directory: '/' + schedule: + interval: monthly + time: '04:00' + timezone: Europe/Berlin + open-pull-requests-limit: 20 + versioning-strategy: increase diff --git a/.github/stale.yml b/.github/stale.yml index 04f9e03..8124ee2 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -12,8 +12,8 @@ onlyLabels: [] # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - - enhancement - - security + - enhancement + - security # Set to true to ignore issues in a project (defaults to false) exemptProjects: true @@ -29,19 +29,19 @@ staleLabel: wontfix # Comment to post when marking as stale. Set to `false` to disable markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs within the next 7 days. - Please check if the issue is still relevant in the most current version of the adapter - and tell us. Also check that all relevant details, logs and reproduction steps - are included and update them if needed. - Thank you for your contributions. - - Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. - Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. - Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, - und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte - enthalten sind bzw. aktualisiert diese. - Vielen Dank für Eure Unterstützung. + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs within the next 7 days. + Please check if the issue is still relevant in the most current version of the adapter + and tell us. Also check that all relevant details, logs and reproduction steps + are included and update them if needed. + Thank you for your contributions. + + Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. + Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. + Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, + und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte + enthalten sind bzw. aktualisiert diese. + Vielen Dank für Eure Unterstützung. # Comment to post when removing the stale label. # unmarkComment: > @@ -49,22 +49,21 @@ markComment: > # Comment to post when closing a stale Issue or Pull Request. closeComment: > - This issue has been automatically closed because of inactivity. Please open a new - issue if still relevant and make sure to include all relevant details, logs and - reproduction steps. - Thank you for your contributions. + This issue has been automatically closed because of inactivity. Please open a new + issue if still relevant and make sure to include all relevant details, logs and + reproduction steps. + Thank you for your contributions. - Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein - neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, - Logs und Reproduktionsschritte enthalten sind. - Vielen Dank für Eure Unterstützung. + Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein + neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, + Logs und Reproduktionsschritte enthalten sind. + Vielen Dank für Eure Unterstützung. # Limit the number of actions per hour, from 1-30. Default is 30 limitPerRun: 30 # Limit to only `issues` or `pulls` only: issues - # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': # pulls: # daysUntilStale: 30 @@ -75,4 +74,4 @@ only: issues # issues: # exemptLabels: -# - confirmed \ No newline at end of file +# - confirmed diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 3b29b57..faa118b 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -6,153 +6,123 @@ name: Test and Release # Run this job on all pushes and pull requests # as well as tags with a semantic version on: - push: - branches: - - '*' - tags: - # normal versions - - "v?[0-9]+.[0-9]+.[0-9]+" - # pre-releases - - "v?[0-9]+.[0-9]+.[0-9]+-**" - pull_request: {} + push: + branches: + - '*' + tags: + # normal versions + - 'v?[0-9]+.[0-9]+.[0-9]+' + # pre-releases + - 'v?[0-9]+.[0-9]+.[0-9]+-**' + pull_request: {} 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 - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - - name: Install Dependencies - run: npm install - -# - name: Perform a type check -# run: npm run check:ts -# env: -# CI: true - # - name: Lint TypeScript code - # run: npm run lint -# - name: Test package files -# run: npm run test:package - - # 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: [14.x, 16.x] - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install Dependencies - run: npm install - - - name: Run local tests - run: npm test -# - name: Run unit tests -# run: npm run test:unit -# - name: Run integration tests # (linux/osx) -# if: startsWith(runner.OS, 'windows') == false -# run: DEBUG=testing:* npm run test:integration -# - name: Run integration tests # (windows) -# if: startsWith(runner.OS, 'windows') -# run: set DEBUG=testing:* & npm run test:integration - - # Deploys the final package to NPM - deploy: - needs: [adapter-tests] - - # Trigger this step only when a commit on master is tagged with a version number - if: | - contains(github.event.head_commit.message, '[skip ci]') == false && - github.event_name == 'push' && - startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Extract the version and commit body from the tag - id: extract_release - # The body may be multiline, therefore we need to escape some characters - run: | - VERSION="${{ github.ref }}" - VERSION=${VERSION##*/} - VERSION=${VERSION##*v} - echo "::set-output name=VERSION::$VERSION" - BODY=$(git show -s --format=%b) - BODY="${BODY//'%'/'%25'}" - BODY="${BODY//$'\n'/'%0A'}" - BODY="${BODY//$'\r'/'%0D'}" - echo "::set-output name=BODY::$BODY" - - - name: Install Dependencies - run: npm install - -# - name: Create a clean build -# run: npm run build - - name: Publish package to npm - run: | - npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} - npm whoami - npm publish - - - name: Create Github Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release v${{ steps.extract_release.outputs.VERSION }} - draft: false - # Prerelease versions create pre-releases on GitHub - prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }} - body: ${{ steps.extract_release.outputs.BODY }} - - #- name: Notify Sentry.io about the release - # run: | - # npm i -g @sentry/cli - # export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} - # export SENTRY_URL=https://sentry.iobroker.net - # export SENTRY_ORG=iobroker - # export SENTRY_PROJECT=iobroker-socketio - # export SENTRY_VERSION=iobroker.socketio@${{ steps.extract_release.outputs.VERSION }} - # sentry-cli releases new $SENTRY_VERSION - # sentry-cli releases finalize $SENTRY_VERSION - - # Add the following line BEFORE finalize if repositories are connected in Sentry - # sentry-cli releases set-commits $SENTRY_VERSION --auto - - # Add the following line BEFORE finalize if sourcemap uploads are needed - # sentry-cli releases files $SENTRY_VERSION upload-sourcemaps build/ + # 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: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Install Dependencies + run: npm install + + # - name: Perform a type check + # run: npm run check:ts + # env: + # CI: true + # - name: Lint TypeScript code + # run: npm run lint + # - name: Test package files + # run: npm run test:package + + # 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: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Install Dependencies + run: npm install + + - name: Run local tests + run: npm test + # - name: Run unit tests + # run: npm run test:unit + # - name: Run integration tests # (linux/osx) + # if: startsWith(runner.OS, 'windows') == false + # run: DEBUG=testing:* npm run test:integration + # - name: Run integration tests # (windows) + # if: startsWith(runner.OS, 'windows') + # run: set DEBUG=testing:* & npm run test:integration + + # Deploys the final package to NPM + deploy: + needs: [adapter-tests] + + # Trigger this step only when a commit on master is tagged with a version number + if: | + contains(github.event.head_commit.message, '[skip ci]') == false && + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Extract the version and commit body from the tag + id: extract_release + # The body may be multiline, therefore we need to escape some characters + run: | + VERSION="${{ github.ref }}" + VERSION=${VERSION##*/} + VERSION=${VERSION##*v} + echo "::set-output name=VERSION::$VERSION" + BODY=$(git show -s --format=%b) + BODY="${BODY//'%'/'%25'}" + BODY="${BODY//$'\n'/'%0A'}" + BODY="${BODY//$'\r'/'%0D'}" + echo "::set-output name=BODY::$BODY" + + - name: Install Dependencies + run: npm install + + # - name: Create a clean build + # run: npm run build + - name: Publish package to npm + run: | + npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} + npm whoami + npm publish + + - name: Create Github Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release v${{ steps.extract_release.outputs.VERSION }} + draft: false + # Prerelease versions create pre-releases on GitHub + prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }} + body: ${{ steps.extract_release.outputs.BODY }}