Build and push packages #509
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: Build and push packages | |
on: | |
workflow_dispatch: | |
inputs: | |
nr_project_nodes_release_name: | |
description: 'nr-project-nodes package version' | |
required: false | |
default: 'nightly' | |
nr_project_nodes_ref: | |
description: 'nr-project-nodes package ref' | |
required: false | |
nr_file_nodes_release_name: | |
description: 'nr-file-nodes package version' | |
required: false | |
default: 'nightly' | |
nr_file_nodes_ref: | |
description: 'nr-file-nodes package ref' | |
required: false | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
uses: 'flowfuse/github-actions-workflows/.github/workflows/build_node_package.yml@v0.34.0' | |
with: | |
node: '[ | |
{"version": "18", "tests": true, "lint": true}, | |
]' | |
nrLauncherPackage: | |
needs: build | |
if: | | |
( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || | |
( github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' ) | |
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.34.0' | |
with: | |
package_name: flowfuse-nr-launcher | |
publish_package: true | |
package_dependencies: | | |
@flowfuse/nr-project-nodes=nightly | |
@flowfuse/nr-file-nodes=nightly | |
@flowfuse/nr-assistant=nightly | |
secrets: | |
npm_registry_token: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
nrThemePackage: | |
needs: build | |
if: | | |
( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || | |
( github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' ) | |
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.34.0' | |
with: | |
package_name: flowfuse-nr-theme | |
publish_package: true | |
working_directory: ./lib/theme | |
disable_ignore_scripts_on_publish: true | |
secrets: | |
npm_registry_token: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
dispatch-nr-container: | |
name: Dispatch node-red container build | |
needs: [nrLauncherPackage, nrThemePackage] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_APP_KEY }} | |
- name: Trigger node-red container build | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: nodered-container.yml | |
repo: flowfuse/helm | |
ref: main | |
token: ${{ steps.generate_token.outputs.token }} | |
dispatch: | |
name: Dispatch localfs package build pipeline | |
runs-on: ubuntu-latest | |
needs: [nrLauncherPackage, nrThemePackage] | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_APP_KEY }} | |
- name: Trigger localfs package build | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: publish.yml | |
repo: flowfuse/driver-localfs | |
ref: main | |
token: ${{ steps.generate_token.outputs.token }} | |
inputs: '{"nr_launcher_ref": "${{ github.ref }}", "nr_launcher_release_name": "${{ needs.nrLauncherPackage.outputs.release_name }}"}' |