Node #299
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: Node | |
| concurrency: | |
| group: Node-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| security-events: write | |
| contents: write | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [Current] | |
| pull_request: | |
| branches: [Current] | |
| workflow_call: | |
| jobs: | |
| Pre-Publish: | |
| runs-on: ubuntu-latest | |
| environment: Deploy | |
| if: ${{ !contains(github.event.head_commit.message, '[Skip=Node]') }} | |
| env: | |
| ADBLOCK: true | |
| ASTRO_TELEMETRY_DISABLED: 1 | |
| AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 | |
| AZURE_CORE_COLLECT_TELEMETRY: 0 | |
| CHOOSENIM_NO_ANALYTICS: 1 | |
| DIEZ_DO_NOT_TRACK: 1 | |
| DO_NOT_TRACK: 1 | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 | |
| ET_NO_TELEMETRY: 1 | |
| GATSBY_TELEMETRY_DISABLED: 1 | |
| GATSBY_TELEMETRY_OPT_OUT: 1 | |
| GATSBY_TELEMETRY_OPTOUT: 1 | |
| GRIT_TELEMETRY_DISABLED: 1 | |
| HASURA_GRAPHQL_ENABLE_TELEMETRY: false | |
| HINT_TELEMETRY: off | |
| HOMEBREW_NO_ANALYTICS: 1 | |
| INFLUXD_REPORTING_DISABLED: true | |
| ITERATIVE_DO_NOT_TRACK: 1 | |
| NEXT_TELEMETRY_DEBUG: 1 | |
| NEXT_TELEMETRY_DISABLED: 1 | |
| NG_CLI_ANALYTICS: false | |
| NUXT_TELEMETRY_DISABLED: 1 | |
| PIN_DO_NOT_TRACK: 1 | |
| POWERSHELL_TELEMETRY_OPTOUT: 1 | |
| SAM_CLI_TELEMETRY: 0 | |
| STNOUPGRADE: 1 | |
| STRIPE_CLI_TELEMETRY_OPTOUT: 1 | |
| TELEMETRY_DISABLED: 1 | |
| TERRAFORM_TELEMETRY: 0 | |
| VCPKG_DISABLE_METRICS: 1 | |
| CF_PAGES_COMMIT_SHA: ${{ github.sha }} | |
| strategy: | |
| matrix: | |
| node-version: [18, 19, 20] | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - shell: bash | |
| run: | | |
| determined_sha="" | |
| trigger_commit_sha="${{ github.sha }}" | |
| trigger_commit_message=$(git log -1 --pretty=%B "$trigger_commit_sha") | |
| if ! (echo "$trigger_commit_message" | grep -q -E "\[Skip=Node\]"); then | |
| determined_sha=$(git rev-parse "$trigger_commit_sha") | |
| else | |
| current_lookup_sha="$trigger_commit_sha" | |
| max_attempts=10 | |
| for i in $(seq 1 $max_attempts); do | |
| if ! git rev-parse --verify "$current_lookup_sha~1" >/dev/null 2>&1; then | |
| break | |
| fi | |
| parent_sha_full=$(git rev-parse "$current_lookup_sha~1") | |
| parent_sha_short=$(git rev-parse "$parent_sha_full") | |
| parent_message=$(git log -1 --pretty=%B "$parent_sha_full") | |
| if ! (echo "$parent_message" | grep -q -E "\[Skip=Node\]"); then | |
| determined_sha="$parent_sha_short" | |
| break | |
| else | |
| current_lookup_sha="$parent_sha_full" | |
| fi | |
| done | |
| fi | |
| if [ -z "$determined_sha" ]; then | |
| if git rev-parse --verify "$trigger_commit_sha~1" >/dev/null 2>&1; then | |
| determined_sha=$(git rev-parse "$trigger_commit_sha~1") | |
| else | |
| determined_sha=$(git rev-parse "$trigger_commit_sha") | |
| fi | |
| fi | |
| echo "CACHE_VERSION_SHA=$determined_sha" >> "$GITHUB_ENV" | |
| - uses: pnpm/action-setup@v4.1.0 | |
| with: | |
| version: 9.3.0 | |
| run_install: | | |
| - recursive: true | |
| args: [ | |
| --link-workspace-packages=true, | |
| --lockfile-only, | |
| --prefer-frozen-lockfile=false, | |
| --shamefully-hoist=false, | |
| --shared-workspace-lockfile=true, | |
| --strict-peer-dependencies=false, | |
| --unsafe-perm=true | |
| ] | |
| - uses: actions/setup-node@v4.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "pnpm" | |
| cache-dependency-path: ./pnpm-lock.yaml | |
| - run: pnpm install | |
| working-directory: . | |
| - run: pnpm run prepublishOnly | |
| working-directory: . | |
| - if: matrix.node-version == '20' | |
| run: | | |
| git config user.name "Node" | |
| git config user.email "Node@PlayForm.Cloud" | |
| git add . | |
| if ! git diff --staged --quiet; then | |
| git commit -m "[Skip=Node]" | |
| fi | |
| - if: matrix.node-version == '20' | |
| uses: ad-m/github-push-action@v0.8.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: Current | |
| - uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: .-Node-${{ matrix.node-version }}-Target | |
| path: ./Target | |
| if-no-files-found: warn |