Skip to content

ioBroker/testing-action-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

testing-action-deploy

Shared Github Actions for ioBroker testing workflows: Deploy step

Inputs

Input Description Required? Default
node-version Node.js version to use in tests. Should be LTS. -
install-command Overwrite the default install command. When changing this, package-cache may need to be disabled. 'npm ci'
package-cache For which package manager dependencies should be cached. Set to 'false' or '' to disable caching. More documentation here. 'npm'
build Set to 'true' when the adapter needs a build step before testing false
build-command Overwrite the default build command 'npm run build'
npm-token The token to use to publish to npm If npm-token is not set, trusted publishing must be activated.
github-token The token to use to create a GitHub release -

If Sentry integration is desired, the following inputs are used to configure it:

Input Description Required? Default
sentry Set to 'true' to enable Sentry releases integration false
sentry-token The token to use to create a Sentry release if sentry is true -
sentry-url Under which URL the Sentry instance is running https://sentry.iobroker.net
sentry-org Which Sentry organization the project is under iobroker
sentry-project The project name on Sentry if sentry is true -
sentry-version-prefix The prefix for release versions on Sentry. Should be something like iobroker.adaptername if sentry is true -
sentry-github-integration Set to true once Github integration is set up in Sentry false
sentry-sourcemap-paths If sourcemaps should be uploaded to Sentry, specify their path here -

Usage

# ... rest of your workflow ...

jobs:
  deploy:
    needs: [check-and-lint, adapter-tests]

    # Trigger this step only when a commit on any branch 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/v')

    runs-on: ubuntu-latest

    # Write permissions are required to create Github releases
    permissions:
      id-token: write
      contents: write

    steps:
      - uses: ioBroker/testing-action-deploy@v1
        with:
          node-version: "14.x" # This should be LTS
          # build: 'true' # optional
          npm-token: ${{ secrets.NPM_TOKEN }} # This must be created on https://www.npmjs.com in your profile under "Access Tokens". Omit this line if trusted publishing is activated.
          github-token: ${{ secrets.GITHUB_TOKEN }} # This exists by default in Github Actions and does not need to be created.
          # If you want Sentry:
          sentry: true
          sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
          sentry-project: "iobroker-my-adapter"
          sentry-version-prefix: "iobroker.my-adapter"
          # ... other options

Usage of TRUSTED PUBLISHING

npm recommends to use trusted publishing. As npm tokens are no longer available for more than 90 days, trusted publishing is the only way to configure a permanent solution. Please follow the official guide to set up trusted publishing for github.

After setting up the configuration at npmjs please ensure that your workflow has been adapted as following:

  • the following permissions are set at workflow test-and.release.yml

    permissions:
        id-token: write
        contents: write
    
  • a npm-token is NOT provided

    - uses: ioBroker/testing-action-deploy@v1
      with:
        node-version: "14.x" # This should be LTS
        # build: 'true' # optional
        npm-token: ${{ secrets.NPM_TOKEN }} # This must be created on https://www.npmjs.com in your profile under "Access Tokens". Omit this line if trusted publishing is activated.
        github-token: ${{ secrets.GITHUB_TOKEN }} # This exists by default in Github Actions and does not need to be created.
    

About

Shared Github Actions for ioBroker testing workflows: Deploy step

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages