From ecdea2faa63e319bc859869acb30ec6b09ce6b2e Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 9 Dec 2024 13:23:12 +0100 Subject: [PATCH] integrate npm-package with conan-package from workflow automation The npm-package.yml file has been deleted, and its functionality is now integrated directly into the conan-package.yml process. This change aims to streamline the workflow by consolidating tasks, reducing redundancy, and ensuring all package-related actions are handled efficiently within a single workflow configuration. Contribute to NP-637 --- .github/workflows/conan-package.yml | 12 ++++++-- .github/workflows/npm-package.yml | 46 ----------------------------- 2 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/npm-package.yml diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 3bb283e78a..82d70aa249 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -10,7 +10,6 @@ on: - 'conandata.yml' - 'CMakeLists.txt' - '.github/workflows/conan-package.yml' - - '.github/workflows/npm-package.yml' branches: - main - 'CURA-*' @@ -31,7 +30,6 @@ on: - 'conandata.yml' - 'CMakeLists.txt' - '.github/workflows/conan-package.yml' - - '.github/workflows/npm-package.yml' branches: - main - 'CURA-*' @@ -42,7 +40,15 @@ on: jobs: conan-package: - uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@NP-637_conan_v2_wasm with: platform_wasm: true secrets: inherit + + npm-package: + needs: [ conan-package ] + if: ${{ github.event_name == 'push' }} + uses: ultimaker/cura-workflows/.github/workflows/npm-package.yml@NP-637_conan_v2_wasm + with: + version_full: ${{ needs.conan-package.outputs.version_full }} + secrets: inherit diff --git a/.github/workflows/npm-package.yml b/.github/workflows/npm-package.yml deleted file mode 100644 index e79350658f..0000000000 --- a/.github/workflows/npm-package.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: NPM package - -on: - workflow_run: - workflows: ["conan-package"] - types: - - completed - -jobs: - conan-recipe-version: - name: Calculate version numbers - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main - permissions: - contents: read - - publish-npm: - runs-on: ubuntu-latest - needs: [ conan-recipe-version ] - permissions: - contents: read - packages: write - - steps: - - name: Setup the build environment - uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@NP-637_conan_v2_wasm # Change to `main` after merge - with: - conan_user: ${{ secrets.CONAN_USER }} - conan_password: ${{ secrets.CONAN_PASS }} - conan_config_branch: "NP-637_conan_v2_wasm" # Remove this line after merging https://github.com/Ultimaker/cura-workflows/pull/32 - install_system_dependencies: true - repository_path: _sources - - - name: Gather/build the packages - run: conan install --requires "${{ needs.conan-recipe-version.outputs.version_full }}" -pr:h cura_wasm.jinja --build=missing --update -of . - - - name: Use Node.js - uses: actions/setup-node@v4 - with: - registry-url: 'https://npm.pkg.github.com' - scope: '@ultimaker' - - - name: Publish to GitHub Packages - run: | - npm publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}