make sloppy imports configurable #467
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 build plugin | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| GIT_REPO_FULL_NAME: | |
| description: Select RepoName | |
| required: false | |
| type: choice | |
| options: | |
| - OHDSI/Data2Evidence | |
| 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] | |
| merge_group: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - deno2.5.6 | |
| - 'release/v*' | |
| 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: | |
| pick_runner: | |
| runs-on: ubuntu-latest | |
| if: (github.ref_name == 'main' || github.ref_name == 'develop' || github.ref_name == 'deno2.5.6' || startsWith(github.ref_name, 'release/') || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft ) # Should run if branch is develop/deno2.5.6/release/workflow_dispatch and doesnt have a PR | |
| outputs: | |
| random_runner: ${{ steps.shuffle.outputs.random_runner }} | |
| steps: | |
| - id: shuffle | |
| run: echo "random_runner=$(shuf -e ubuntu-22.04 ubuntu-24.04 | head -n 1)" >> "$GITHUB_OUTPUT" | |
| build: | |
| needs: [pick_runner] | |
| if: (github.ref_name == 'main' || github.ref_name == 'develop' || github.ref_name == 'deno2.5.6' || startsWith(github.ref_name, 'release/') || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft ) # Should run if branch is develop/deno2.5.6/release/workflow_dispatch and doesnt have a PR | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - PKGPATH: ./ext/trexas | |
| runs-on: ${{ matrix.RUNNER || needs.pick_runner.outputs.random_runner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.GIT_BRANCH_NAME }} | |
| repository: ${{ env.GIT_REPO_FULL_NAME }} | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18.x" | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "@trex" | |
| - name: Setup NPM | |
| if: ${{ matrix.NPM }} | |
| run: npm install -g ${{ matrix.NPM }} | |
| - name: Install dependencies | |
| if: ${{ matrix.DESTPATH }} | |
| run: | | |
| npm install -g deno@2.1.13 | |
| node ./install-deno-deps.js ${{ matrix.PKGPATH }} | |
| - 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 | |
| elif [[ $GITHUB_REF_NAME == 'deno2.5.6' ]]; then | |
| jq --arg v "-$(date +%s)-$GITHUB_SHA-d256" '.version+=$v' package.json > tmppkg; mv tmppkg package.json | |
| elif [[ $GITHUB_REF_NAME == release/v* ]]; then | |
| BRANCH_SUFFIX=${GITHUB_REF_NAME#release/} | |
| jq --arg v "-$(date +%s)-${BRANCH_SUFFIX}-$GITHUB_SHA" '.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: Clean V8 cache | |
| working-directory: ${{ matrix.PKGPATH }} | |
| run: rm -rf target/*/gn_out target/*/obj/librusty_v8.a || true | |
| - name: Build | |
| run: | | |
| cd ${{ matrix.PKGPATH }} | |
| ${{ matrix.NPM == 'yarn' && 'yarn install' ||'npm install --ignore-scripts' }} | |
| env: | |
| CI: ${{ matrix.NPM != 'yarn' }} | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Patch Package | |
| if: ${{ matrix.NPM }} | |
| working-directory: ${{ matrix.PKGPATH }} | |
| run: jq '.private=false' package.json > tmppkg; mv tmppkg package.json | |
| - name: DEST | |
| working-directory: ${{ matrix.PKGPATH }} | |
| if: ${{ matrix.DESTPATH }} | |
| run: | | |
| cp package.json package.org.json | |
| sudo mkdir -p ${{ matrix.DESTPATH }} | |
| sudo chown runner:docker ${{ matrix.DESTPATH }} | |
| cp -a . ${{ matrix.DESTPATH }} | |
| cd ${{ matrix.DESTPATH }} | |
| export TREX_DOCKER_TAG=sha256:468f1fa411b288f8ebac842dc0982bb7b8cb2d5eeb8dc25a494b734fcacfac42 | |
| #$(grep -m1 '^FROM ' $GITHUB_WORKSPACE/services/trex/Dockerfile | sed -E 's/.*@(sha256:[a-f0-9]+).*/\1/') | |
| echo "Using TREX_DOCKER_TAG=$TREX_DOCKER_TAG" | |
| npm run build | |
| - 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: "@trex" | |
| - 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: "@trex" | |
| - 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: "@trex" | |
| - name: Publish | |
| env: | |
| CI: ${{ matrix.NPM != 'yarn' }} | |
| SHOULD_PUBLISH: ${{ github.ref_name == 'main' || github.ref_name == 'develop' || github.ref_name == 'deno2.5.6' || startsWith(github.ref_name, 'release/') || github.event_name == 'workflow_dispatch' }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_PROJECT_TOKEN }} | |
| DUCKDB_EXTENSION_SIGNING_KEY: ${{ secrets.DUCKDB_EXTENSION_SIGNING_KEY }} | |
| run: | | |
| cd ${{ matrix.DESTPATH || matrix.PKGPATH }} | |
| if [[ $SHOULD_PUBLISH == true ]]; then | |
| ${{ matrix.NPM || 'npm' }} publish | |
| else | |
| ${{ matrix.NPM || 'npm' }} pack | |
| fi | |
| success: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check | |
| run: echo "Check" |