Add platform option in dc #191
Workflow file for this run
This file contains hidden or 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: d2e-flows build plugin | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| GIT_REPO_FULL_NAME: | |
| description: Select RepoName | |
| required: false | |
| type: choice | |
| options: | |
| - data2evidence/d2e | |
| GIT_BRANCH_NAME: | |
| default: develop | |
| description: Enter BranchName / ReleaseTagName | |
| required: true | |
| type: string | |
| tag: | |
| description: Enter tag for release | |
| required: true | |
| type: string | |
| release: | |
| description: Enter name for github release | |
| required: true | |
| type: string | |
| prerelease: | |
| type: boolean | |
| default: true | |
| required: true | |
| overwrite: | |
| type: boolean | |
| default: true | |
| required: true | |
| artifacttype: | |
| type: choice | |
| required: true | |
| default: "OSS-develop" | |
| options: | |
| - "OSS-develop" | |
| - "OSS-release" | |
| - "Project" | |
| pull_request: | |
| types: [opened, ready_for_review, reopened, synchronize] | |
| push: | |
| branches: | |
| - develop | |
| env: | |
| GIT_BRANCH_NAME: ${{ github.event.inputs.GIT_BRANCH_NAME || github.head_ref || github.ref_name }} # workflow_dispatch || pull_request || push | |
| GIT_REPO_FULL_NAME: ${{ github.event.inputs.GIT_REPO_FULL_NAME || github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} # workflow_dispatch || pull_request || push | |
| NPM_ARTIFACT_TYPE: ${{ github.event.inputs.artifacttype || 'OSS-develop'}} | |
| jobs: | |
| check_file_changes: | |
| runs-on: ubuntu-latest | |
| if: (github.ref_name == 'develop' || contains('release/', github.ref_name) || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft ) # Should run if branch is develop/release/workflow_dispatch and doesnt have a PR | |
| outputs: | |
| changes: ${{ steps.file_changes.outputs.src }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3.0.2 | |
| id: file_changes | |
| with: | |
| initial-fetch-depth: 1 | |
| filters: | | |
| src: | |
| - "flows/**" | |
| - "package.json" | |
| - "docker-compose.yml" | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [check_file_changes] | |
| if: (github.ref_name == 'develop' || contains('release', github.ref_name) || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft && needs.check_file_changes.outputs.changes == 'true' ) # Should run if branch is develop/release/workflow_dispatch and doesnt have a PR | |
| defaults: | |
| run: | |
| working-directory: ./flows | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - PKGPATH: ./base/ | |
| - PKGPATH: ./cohort_survival/ | |
| - PKGPATH: ./data_mapping/ | |
| - PKGPATH: ./dicom_etl/ | |
| - PKGPATH: ./mimic_omop_conversion/ | |
| - PKGPATH: ./nlp/ | |
| - PKGPATH: ./white_rabbit/ | |
| - PKGPATH: ./i2b2/ | |
| - PKGPATH: ./search_embedding/ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.GIT_BRANCH_NAME }} | |
| repository: ${{ env.GIT_REPO_FULL_NAME }} | |
| submodules: recursive | |
| - name: Use Node.js - OSS Develop | |
| uses: actions/setup-node@v4 | |
| if: env.NPM_ARTIFACT_TYPE == 'OSS-develop' | |
| with: | |
| node-version: "18.x" | |
| registry-url: "https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/d2e/npm/registry/" | |
| scope: "@data2evidence" | |
| - name: Use Node.js - OSS Release | |
| uses: actions/setup-node@v4 | |
| if: env.NPM_ARTIFACT_TYPE == 'OSS-release' | |
| with: | |
| node-version: "18.x" | |
| registry-url: "https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/stable/npm/registry/" | |
| scope: "@data2evidence" | |
| - name: Use Node.js - Project | |
| uses: actions/setup-node@v4 | |
| if: env.NPM_ARTIFACT_TYPE == 'Project' | |
| with: | |
| node-version: "18.x" | |
| registry-url: "https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/ms/npm/registry/" | |
| scope: "@data2evidence" | |
| - name: Update version | |
| run: | | |
| cd ${{ matrix.PKGPATH }} | |
| if [[ $GITHUB_EVENT_NAME == 'workflow_dispatch' ]]; then | |
| RELEASE_VERSION=${{ github.event.inputs.tag }} | |
| jq --arg v $RELEASE_VERSION '.version=$v' package.json > tmppkg; mv tmppkg package.json | |
| else | |
| jq --arg v "-$(date +%s)-$GITHUB_SHA" '.version+=$v' package.json > tmppkg; mv tmppkg package.json | |
| fi | |
| - name: Publish | |
| env: | |
| SHOULD_PUBLISH: ${{ github.ref_name == 'develop' || github.event_name == 'workflow_dispatch' }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_PROJECT_TOKEN }} | |
| run: | | |
| cd ${{ matrix.PKGPATH }} | |
| if [[ $SHOULD_PUBLISH == true ]]; then | |
| npm publish | |
| else | |
| npm publish --dry-run | |
| fi | |
| success: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check | |
| run: echo "Check" |