diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c90851c..731b0325 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,26 +40,26 @@ jobs: id: self_mutation run: |- git add . - git diff --staged --patch --exit-code > .repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT + git diff --staged --patch --exit-code > repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT working-directory: ./ - name: Upload patch if: steps.self_mutation.outputs.self_mutation_happened - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: - name: .repo.patch - path: .repo.patch + name: repo.patch + path: repo.patch overwrite: true - name: Fail build on mutation if: steps.self_mutation.outputs.self_mutation_happened run: |- echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch." - cat .repo.patch + cat repo.patch exit 1 - name: Backup artifact permissions run: cd dist && getfacl -R . > permissions-backup.acl continue-on-error: true - name: Upload artifact - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -80,10 +80,10 @@ jobs: - name: Download patch uses: actions/download-artifact@v4 with: - name: .repo.patch + name: repo.patch path: ${{ runner.temp }} - name: Apply patch - run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + run: '[ -s ${{ runner.temp }}/repo.patch ] && git apply ${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."' - name: Set git identity run: |- git config user.name "github-actions" @@ -99,7 +99,7 @@ jobs: needs: build runs-on: ubuntu-latest permissions: {} - if: "! needs.build.outputs.self_mutation_happened" + if: ${{ !needs.build.outputs.self_mutation_happened }} steps: - uses: actions/setup-node@v4 with: @@ -116,11 +116,19 @@ jobs: uses: pnpm/action-setup@v3 with: version: "9" - - name: Prepare Repository - run: mv dist .repo + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + path: .repo - name: Install Dependencies run: cd .repo && pnpm i --frozen-lockfile + - name: Extract build artifact + run: tar --strip-components=1 -xzvf dist/js/*.tgz -C .repo + - name: Move build artifact out of the way + run: mv dist dist.old - name: Create js artifact run: cd .repo && npx projen package:js - - name: Collect js Artifact + - name: Collect js artifact run: mv .repo/dist dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 513ba3e0..2aeff70d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Check if version has already been tagged id: check_tag_exists run: |- - TAG=$(cat dist/dist/releasetag.txt) + TAG=$(cat dist/releasetag.txt) ([ ! -z "$TAG" ] && git ls-remote -q --exit-code --tags origin $TAG && (echo "exists=true" >> $GITHUB_OUTPUT)) || (echo "exists=false" >> $GITHUB_OUTPUT) cat $GITHUB_OUTPUT - name: Check for new commits @@ -59,7 +59,7 @@ jobs: continue-on-error: true - name: Upload artifact if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -85,10 +85,6 @@ jobs: - name: Restore build artifact permissions run: cd dist && setfacl --restore=permissions-backup.acl continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Collect GitHub Metadata - run: mv .repo/dist dist - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -120,13 +116,19 @@ jobs: uses: pnpm/action-setup@v3 with: version: "9" - - name: Prepare Repository - run: mv dist .repo + - name: Checkout + uses: actions/checkout@v4 + with: + path: .repo - name: Install Dependencies run: cd .repo && pnpm i --frozen-lockfile + - name: Extract build artifact + run: tar --strip-components=1 -xzvf dist/js/*.tgz -C .repo + - name: Move build artifact out of the way + run: mv dist dist.old - name: Create js artifact run: cd .repo && npx projen package:js - - name: Collect js Artifact + - name: Collect js artifact run: mv .repo/dist dist - name: Release env: diff --git a/.github/workflows/update-projen-main.yml b/.github/workflows/update-projen-main.yml index 930dd53b..f0c924cb 100644 --- a/.github/workflows/update-projen-main.yml +++ b/.github/workflows/update-projen-main.yml @@ -34,14 +34,14 @@ jobs: id: create_patch run: |- git add . - git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT + git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT working-directory: ./ - name: Upload patch if: steps.create_patch.outputs.patch_created - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: - name: .repo.patch - path: .repo.patch + name: repo.patch + path: repo.patch overwrite: true pr: name: Create Pull Request @@ -58,10 +58,10 @@ jobs: - name: Download patch uses: actions/download-artifact@v4 with: - name: .repo.patch + name: repo.patch path: ${{ runner.temp }} - name: Apply patch - run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + run: '[ -s ${{ runner.temp }}/repo.patch ] && git apply ${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."' - name: Set git identity run: |- git config user.name "github-actions" diff --git a/.projen/tasks.json b/.projen/tasks.json index 46134a61..b278b841 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -155,7 +155,7 @@ "description": "Creates the distribution package", "steps": [ { - "exec": "rsync -a . .repo --exclude .git --exclude node_modules && rm -rf dist && mv .repo dist", + "spawn": "package:js", "condition": "node -e \"if (!process.env.CI) process.exit(1)\"" }, { diff --git a/package.json b/package.json index 87017824..eb207a9f 100644 --- a/package.json +++ b/package.json @@ -54,17 +54,17 @@ "jsii-pacmak": "^1.100.0", "jsii-rosetta": "~5.4.0", "prettier": "^3.3.2", - "projen": "^0.86.7", + "projen": "^0.87.0", "ts-jest": "^29.1.5", "ts-node": "^10.9.2", "typescript": "^5.5.2" }, "peerDependencies": { - "projen": "^0.86.7" + "projen": "^0.87.0" }, "dependencies": { "cson-parser": "^4.0.9", - "projen": "^0.86.7", + "projen": "^0.87.0", "semver": "^7.6.2", "ts-deepmerge": "^6.2.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d69ef63d..0638937c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^4.0.9 version: 4.0.9 projen: - specifier: ^0.86.7 - version: 0.86.7(constructs@10.3.0) + specifier: ^0.87.0 + version: 0.87.0(constructs@10.3.0) semver: specifier: ^7.6.2 version: 7.6.2 @@ -2267,8 +2267,8 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - projen@0.86.7: - resolution: {integrity: sha512-bNJVggJggmKaNGwoQ0FK1OgVbLv7Uf3hzKRkU3n5R4LhcfGoLFWvvZ9Y4fI/+FEowqhNrnukiG8Z2PhIMjuxwg==} + projen@0.87.0: + resolution: {integrity: sha512-XGAYLxtNp+azXFQyFRiH3AN4ahw8oolhRz1yq/eowRTuIf/WrX2qjznTR1PGVc1uKauo+3aPEHJz0OfiOUJJLg==} engines: {node: '>= 16.0.0'} hasBin: true peerDependencies: @@ -2762,8 +2762,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@5.7.0-dev.20240903: - resolution: {integrity: sha512-XTUc5uVwBbLlT0v3FqTx9sDN1MLQnT5mwSC3JefCrcKT6Zv+rPcQE7HLKM9IsrNiM1tiaQvamJTgVH0S+UMH2A==} + typescript@5.7.0-dev.20240904: + resolution: {integrity: sha512-iGi6VWFGOuxPvDfwfK1/8C172NWzC5gtC4G2dxqCQehrr86WTfFkc9aWucynaxZdwQNMqG1Iu83bmXD7CNHCmg==} engines: {node: '>=14.17'} hasBin: true @@ -4163,7 +4163,7 @@ snapshots: dependencies: semver: 7.6.2 shelljs: 0.8.5 - typescript: 5.7.0-dev.20240903 + typescript: 5.7.0-dev.20240904 electron-to-chromium@1.4.811: {} @@ -5685,7 +5685,7 @@ snapshots: process-nextick-args@2.0.1: {} - projen@0.86.7(constructs@10.3.0): + projen@0.87.0(constructs@10.3.0): dependencies: constructs: 10.3.0 @@ -6162,7 +6162,7 @@ snapshots: typescript@5.5.2: {} - typescript@5.7.0-dev.20240903: {} + typescript@5.7.0-dev.20240904: {} uglify-js@3.18.0: optional: true diff --git a/test/__snapshots__/cdk-context-json.test.ts.snap b/test/__snapshots__/cdk-context-json.test.ts.snap index 65ad7158..60756868 100644 --- a/test/__snapshots__/cdk-context-json.test.ts.snap +++ b/test/__snapshots__/cdk-context-json.test.ts.snap @@ -95,20 +95,20 @@ jobs: id: self_mutation run: |- git add . - git diff --staged --patch --exit-code > .repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT + git diff --staged --patch --exit-code > repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT working-directory: ./ - name: Upload patch if: steps.self_mutation.outputs.self_mutation_happened - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: - name: .repo.patch - path: .repo.patch + name: repo.patch + path: repo.patch overwrite: true - name: Fail build on mutation if: steps.self_mutation.outputs.self_mutation_happened run: |- echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch." - cat .repo.patch + cat repo.patch exit 1 self-mutation: needs: build @@ -126,10 +126,10 @@ jobs: - name: Download patch uses: actions/download-artifact@v4 with: - name: .repo.patch + name: repo.patch path: \${{ runner.temp }} - name: Apply patch - run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + run: '[ -s \${{ runner.temp }}/repo.patch ] && git apply \${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."' - name: Set git identity run: |- git config user.name "github-actions" diff --git a/test/__snapshots__/clickup-cdk.test.ts.snap b/test/__snapshots__/clickup-cdk.test.ts.snap index aed049bf..b4d75afc 100644 --- a/test/__snapshots__/clickup-cdk.test.ts.snap +++ b/test/__snapshots__/clickup-cdk.test.ts.snap @@ -195,7 +195,7 @@ jobs: - name: Check if version has already been tagged id: check_tag_exists run: |- - TAG=$(cat dist/dist/releasetag.txt) + TAG=$(cat dist/releasetag.txt) ([ ! -z "$TAG" ] && git ls-remote -q --exit-code --tags origin $TAG && (echo "exists=true" >> $GITHUB_OUTPUT)) || (echo "exists=false" >> $GITHUB_OUTPUT) cat $GITHUB_OUTPUT - name: Check for new commits @@ -209,7 +209,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -235,10 +235,6 @@ jobs: - name: Restore build artifact permissions run: cd dist && setfacl --restore=permissions-backup.acl continue-on-error: true - - name: Prepare Repository - run: mv dist .repo - - name: Collect GitHub Metadata - run: mv .repo/dist dist - name: Release env: GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} @@ -275,15 +271,21 @@ jobs: EOF - name: Make cdk-ecr-deployment sane run: export FORCE_PREBUILT_LAMBDA=1 - - name: Prepare Repository - run: mv dist .repo + - name: Checkout + uses: actions/checkout@v4 + with: + path: .repo - name: Install Dependencies run: cd .repo && yarn install --check-files --frozen-lockfile - - name: Create js artifact - run: cd .repo && npx projen package:js + - name: Extract build artifact + run: tar --strip-components=1 -xzvf dist/js/*.tgz -C .repo - name: Remove ~/.npmrc file for release run: rm ~/.npmrc || true - - name: Collect js Artifact + - name: Move build artifact out of the way + run: mv dist dist.old + - name: Create js artifact + run: cd .repo && npx projen package:js + - name: Collect js artifact run: mv .repo/dist dist - name: Release env: @@ -414,7 +416,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -878,7 +880,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -1342,7 +1344,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -1533,7 +1535,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -1728,7 +1730,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -1927,7 +1929,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -2118,7 +2120,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist diff --git a/test/__snapshots__/clickup-ts.test.ts.snap b/test/__snapshots__/clickup-ts.test.ts.snap index 3ce9851a..4b9053bb 100644 --- a/test/__snapshots__/clickup-ts.test.ts.snap +++ b/test/__snapshots__/clickup-ts.test.ts.snap @@ -68,7 +68,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist diff --git a/test/__snapshots__/datadog-service-catalog.test.ts.snap b/test/__snapshots__/datadog-service-catalog.test.ts.snap index 76555235..1fafece0 100644 --- a/test/__snapshots__/datadog-service-catalog.test.ts.snap +++ b/test/__snapshots__/datadog-service-catalog.test.ts.snap @@ -49,7 +49,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -182,7 +182,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist diff --git a/test/__snapshots__/datadog.test.ts.snap b/test/__snapshots__/datadog.test.ts.snap index 404c577a..1903b28c 100644 --- a/test/__snapshots__/datadog.test.ts.snap +++ b/test/__snapshots__/datadog.test.ts.snap @@ -49,7 +49,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -158,7 +158,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -267,7 +267,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist diff --git a/test/__snapshots__/slack-alert.test.ts.snap b/test/__snapshots__/slack-alert.test.ts.snap index 742f283d..dee54f42 100644 --- a/test/__snapshots__/slack-alert.test.ts.snap +++ b/test/__snapshots__/slack-alert.test.ts.snap @@ -49,7 +49,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist @@ -156,7 +156,7 @@ jobs: continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: name: build-artifact path: dist diff --git a/test/__snapshots__/update-projen.test.ts.snap b/test/__snapshots__/update-projen.test.ts.snap index 781980fe..46017dd4 100644 --- a/test/__snapshots__/update-projen.test.ts.snap +++ b/test/__snapshots__/update-projen.test.ts.snap @@ -55,14 +55,14 @@ jobs: id: create_patch run: |- git add . - git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT + git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT working-directory: ./ - name: Upload patch if: steps.create_patch.outputs.patch_created - uses: actions/upload-artifact@v4.3.6 + uses: actions/upload-artifact@v4.4.0 with: - name: .repo.patch - path: .repo.patch + name: repo.patch + path: repo.patch overwrite: true pr: name: Create Pull Request @@ -79,10 +79,10 @@ jobs: - name: Download patch uses: actions/download-artifact@v4 with: - name: .repo.patch + name: repo.patch path: \${{ runner.temp }} - name: Apply patch - run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + run: '[ -s \${{ runner.temp }}/repo.patch ] && git apply \${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."' - name: Set git identity run: |- git config user.name "github-actions"