diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a87438b..660be1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,26 +50,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 @@ -90,10 +90,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" @@ -108,8 +108,9 @@ jobs: package-js: needs: build runs-on: ubuntu-latest - permissions: {} - if: "! needs.build.outputs.self_mutation_happened" + permissions: + contents: read + if: ${{ !needs.build.outputs.self_mutation_happened }} steps: - uses: actions/setup-node@v4 with: @@ -136,11 +137,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/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml index 2c1c658..100c15e 100644 --- a/.github/workflows/pull-request-lint.yml +++ b/.github/workflows/pull-request-lint.yml @@ -10,12 +10,14 @@ on: - reopened - ready_for_review - edited + merge_group: {} jobs: validate: name: Validate PR title runs-on: ubuntu-latest permissions: pull-requests: write + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') steps: - uses: amannn/action-semantic-pull-request@v5.4.0 env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5ed2a8..1323816 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,9 @@ on: branches: - main workflow_dispatch: {} +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false jobs: release: runs-on: ubuntu-latest @@ -55,7 +58,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 @@ -69,7 +72,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 @@ -95,10 +98,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 }} @@ -139,15 +138,21 @@ 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: Remove ~/.npmrc file for release run: rm ~/.npmrc || true + - 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 9b30640..44fa12d 100644 --- a/.github/workflows/update-projen-main.yml +++ b/.github/workflows/update-projen-main.yml @@ -44,14 +44,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 @@ -68,10 +68,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/.mergify.yml b/.mergify.yml index 154b39f..e8c3ed2 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -8,17 +8,17 @@ queue_rules: - -label~=(do-not-merge) - status-success=build - status-success=package-js + merge_method: squash + commit_message_template: |- + {{ title }} (#{{ number }}) + + {{ body }} pull_request_rules: - name: Automatic merge on approval and successful build actions: delete_head_branch: {} queue: - method: squash name: default - commit_message_template: |- - {{ title }} (#{{ number }}) - - {{ body }} conditions: - "#approved-reviews-by>=1" - -label~=(do-not-merge) diff --git a/.projen/tasks.json b/.projen/tasks.json index 4ca4a03..d70e212 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)\"" }, { @@ -271,7 +271,7 @@ }, "steps": [ { - "exec": "pnpm dlx npm-check-updates@16 --upgrade --target=latest --peer --dep=dev,peer,prod,optional --filter=projen,@time-loop/clickup-projen" + "exec": "pnpm dlx npm-check-updates@16 --upgrade --target=latest --peer --no-deprecated --dep=dev,peer,prod,optional --filter=projen,@time-loop/clickup-projen" }, { "exec": "pnpm i --no-frozen-lockfile" @@ -295,7 +295,7 @@ }, "steps": [ { - "exec": "pnpm dlx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@time-loop/clickup-projen,@types/jest,esbuild,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,jest,jsii-diff,jsii-pacmak,jsii-release,prettier,projen,ts-jest" + "exec": "pnpm dlx npm-check-updates@16 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@time-loop/clickup-projen,@types/jest,esbuild,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,jest,jsii-diff,jsii-pacmak,jsii-release,prettier,projen,ts-jest" }, { "exec": "pnpm i --no-frozen-lockfile" diff --git a/package.json b/package.json index be3586a..330d5c1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "organization": true }, "devDependencies": { - "@time-loop/clickup-projen": "^1.13.2", + "@time-loop/clickup-projen": "^1.13.5", "@types/jest": "^29.5.12", "@types/node": "^18", "@typescript-eslint/eslint-plugin": "^7", @@ -58,7 +58,7 @@ "jsii-release": "^0.2.838", "jsii-rosetta": "~5.3.0", "prettier": "^3.2.5", - "projen": "^0.86.7", + "projen": "^0.90.0", "ts-jest": "^29.1.3", "ts-node": "^10", "typescript": "~5.3.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c46924..a7f4888 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@time-loop/clickup-projen': - specifier: ^1.13.2 - version: 1.13.2(projen@0.86.7(constructs@10.0.5)) + specifier: ^1.13.5 + version: 1.13.5(projen@0.90.0(constructs@10.0.5)) '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -78,8 +78,8 @@ importers: specifier: ^3.2.5 version: 3.2.5 projen: - specifier: ^0.86.7 - version: 0.86.7(constructs@10.0.5) + specifier: ^0.90.0 + version: 0.90.0(constructs@10.0.5) ts-jest: specifier: ^29.1.3 version: 29.1.4(@babel/core@7.24.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.5))(esbuild@0.21.4)(jest@29.7.0(@types/node@18.19.33)(ts-node@10.9.2(@types/node@18.19.33)(typescript@5.3.3)))(typescript@5.3.3) @@ -862,11 +862,11 @@ packages: resolution: {integrity: sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==} engines: {node: '>=16.0.0'} - '@time-loop/clickup-projen@1.13.2': - resolution: {integrity: sha512-161UQiklCwKWA9XbQIcvl3z4iHbi4UvcFLa7b/IDSOZFW641lOejr39T6/lomBsPlGschGs8wO2VpoEDoRKo/g==, tarball: https://npm.pkg.github.com/download/@time-loop/clickup-projen/1.13.2/955b19a4c8c5857ac3a30b3cd2fddfa429aa365d} + '@time-loop/clickup-projen@1.13.5': + resolution: {integrity: sha512-jdL0KJ8qtuVkEqUnrWPi9GugGWx/q0dzBWDl8t8SvwusGsii3Uuj5YJiHXMrfC9UEUTH8gI6cljGVySw/H3mfw==, tarball: https://npm.pkg.github.com/download/@time-loop/clickup-projen/1.13.5/e441ab3af5d6a6fda73b7676194e37f1ec5ad5e6} engines: {node: '>= 18.17.1'} peerDependencies: - projen: ^0.86.7 + projen: ^0.90.0 bundledDependencies: - cson-parser - semver @@ -2758,8 +2758,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.90.0: + resolution: {integrity: sha512-klJXSriGl/w+9Gj22vNenq8DjMBIscaOArt0aSTtPjeZyb5s0OSrDF0ALSzlLfz4x7dT8jRB2C8sb9tuuR/sUA==} engines: {node: '>= 16.0.0'} hasBin: true peerDependencies: @@ -3255,8 +3255,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.20241104: + resolution: {integrity: sha512-cz5/yx6iInIMoiEsKTQm/4iZ0PbTMPUtSOUrVc8jvdAg9k5qDiSkq4+TOqZvqKnEMK+5TM1yM983dwABaaeudg==} engines: {node: '>=14.17'} hasBin: true @@ -4713,9 +4713,9 @@ snapshots: '@smithy/util-buffer-from': 3.0.0 tslib: 2.6.2 - '@time-loop/clickup-projen@1.13.2(projen@0.86.7(constructs@10.0.5))': + '@time-loop/clickup-projen@1.13.5(projen@0.90.0(constructs@10.0.5))': dependencies: - projen: 0.86.7(constructs@10.0.5) + projen: 0.90.0(constructs@10.0.5) '@tsconfig/node10@1.0.11': {} @@ -5452,7 +5452,7 @@ snapshots: dependencies: semver: 7.6.2 shelljs: 0.8.5 - typescript: 5.7.0-dev.20240903 + typescript: 5.7.0-dev.20241104 electron-to-chromium@1.4.763: {} @@ -5601,7 +5601,7 @@ snapshots: debug: 4.3.4 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 @@ -5613,7 +5613,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -5634,7 +5634,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -7050,7 +7050,7 @@ snapshots: process-nextick-args@2.0.1: {} - projen@0.86.7(constructs@10.0.5): + projen@0.90.0(constructs@10.0.5): dependencies: constructs: 10.0.5 @@ -7532,7 +7532,7 @@ snapshots: typescript@5.3.3: {} - typescript@5.7.0-dev.20240903: {} + typescript@5.7.0-dev.20241104: {} uglify-js@3.17.4: optional: true