diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 83e96a4456..b9a51384ad 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -82,10 +82,13 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 0 # Fetch all history for all branches - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: mkdir -p ~/.npm @@ -114,8 +117,15 @@ jobs: git config user.name "prosoponator[bot]" git config user.email "dev@prosopo.io" + # check the source branch (e.g. staging) is up-to-date with the dest branch (e.g. main) + if [ "$(git rev-list --count origin/${{ github.event.inputs.src }}..origin/${{ github.event.inputs.dest }})" -ne 0 ]; then + echo "Source branch ${{ github.event.inputs.src }} is not up-to-date with destination branch ${{ github.event.inputs.dest }}. PR destination branch into the source branch and try again." + exit 1 + else + echo "Source branch ${{ github.event.inputs.src }} is up-to-date with destination branch ${{ github.event.inputs.dest }}" + fi + # checkout the src branch - git fetch --all git checkout ${{ github.event.inputs.src }} INTERIM="${{ github.event.inputs.interim}}" diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index c4dc54ed78..3ce56524c4 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -64,6 +64,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" # make cache dirs, these must exist before doing cache stuff - run: mkdir -p ~/.npm @@ -74,7 +76,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index be0970efc8..112e1a786b 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -71,6 +71,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -92,7 +94,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44d549ec5d..efeb419aba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -70,6 +70,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -91,7 +93,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/ls_cache.yml b/.github/workflows/ls_cache.yml index acb1d284a8..d150a6aa22 100644 --- a/.github/workflows/ls_cache.yml +++ b/.github/workflows/ls_cache.yml @@ -62,6 +62,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress diff --git a/.github/workflows/provider_image.yml b/.github/workflows/provider_image.yml index 604415349f..c13ef0fe80 100644 --- a/.github/workflows/provider_image.yml +++ b/.github/workflows/provider_image.yml @@ -70,6 +70,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -91,7 +93,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72b4620216..ee79d242ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,8 @@ jobs: npm-${{ runner.os }}-${{ runner.arch }}- - uses: actions/checkout@v4 + with: + submodules: "recursive" - name: Detect env id: env @@ -124,7 +126,7 @@ jobs: echo "docker_latest_tag=staging"; echo "docker_version_tag=staging"; echo "gh_release_tag=staging-release" - echo "gh_prelease=true" + echo "gh_prerelease=true" } >> $GITHUB_OUTPUT else echo "cannot deploy from branch ${{ github.ref }}" @@ -133,7 +135,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci @@ -156,6 +158,7 @@ jobs: - name: Mark Github release as prerelease if: ${{ steps.env.outputs.gh_prerelease }} + continue-on-error: true # don't fail the workflow if the release can't be resolved run: | gh release edit "${{ steps.env.outputs.gh_release_tag }}" --prerelease diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd7691f4f6..0c9612a5ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,6 +71,8 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - run: mkdir -p ~/.npm - run: mkdir -p ~/.cache/Cypress @@ -92,7 +94,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - run: npm ci diff --git a/.github/workflows/prosoponator_bot.yml b/.github/workflows/update_staging.yml similarity index 71% rename from .github/workflows/prosoponator_bot.yml rename to .github/workflows/update_staging.yml index 9809214019..4591b7b7b4 100644 --- a/.github/workflows/prosoponator_bot.yml +++ b/.github/workflows/update_staging.yml @@ -1,8 +1,15 @@ -# Run prosoponator bot on any comments +# update staging on push to main -name: prosoponator_bot +name: update_staging -on: issue_comment +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }} @@ -10,14 +17,8 @@ env: CARGO_TERM_COLOR: always NODE_OPTIONS: "--max-old-space-size=4096" -defaults: - run: - shell: bash - jobs: - comment: - # This job only runs for pull request comments - if: ${{ github.event.issue.pull_request && github.event.pull_request.draft == false }} + deploy: runs-on: ubuntu-latest steps: - name: Print contexts @@ -59,16 +60,26 @@ jobs: echo "******************************" - uses: actions/checkout@v4 + with: + submodules: "recursive" - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: 'package.json' + - run: npm i -g "npm@$(jq -r .engines.npm < package.json)" - - name: Run - env: - GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }} + - name: PR main into staging run: | - npm ci - cd dev/prosoponator-bot - npx tsx src/bot.ts + set -euo pipefail # stop on errors, print commands, fail on pipe fails + + # set the author in git + git config user.name "prosoponator[bot]" + git config user.email "dev@prosopo.io" + + # checkout the src branch + git fetch --all + git checkout main + + # create a PR for the release + gh pr create --base staging --title "Bring staging up to date with main" --fill diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 209e3ef4b6..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/biome.json b/biome.json index 3e4782e87b..ef847ffe4d 100644 --- a/biome.json +++ b/biome.json @@ -19,7 +19,11 @@ "**/*.jsonc", "**/*.css" ], - "ignore": ["./packages/detector/src/index.js", "*.bundle.js"] + "ignore": [ + "./packages/detector/src/index.js", + "*.bundle.js", + "./packages/provider/src/tasks/detection/decodePayload.js" + ] }, "linter": { "rules": { diff --git a/demos/client-bundle-example/package.json b/demos/client-bundle-example/package.json index e152ea809d..f3caf24bc3 100644 --- a/demos/client-bundle-example/package.json +++ b/demos/client-bundle-example/package.json @@ -13,14 +13,14 @@ "start": "vite serve ./src --port 9232 --config vite.config.ts", "clean": "echo 'nothing to clean'" }, - "version": "2.1.4", + "version": "2.1.5", "devDependencies": { - "@prosopo/dotenv": "2.1.4", + "@prosopo/dotenv": "2.1.5", "@types/node": "22.5.5", "@vitest/coverage-v8": "2.1.1", "concurrently": "9.0.1", "npm-run-all": "4.1.5", - "rimraf": "6.0.1", + "del-cli": "6.0.0", "tslib": "2.7.0", "tsx": "4.19.1", "typescript": "5.6.2", diff --git a/demos/client-bundle-example/src/index.html b/demos/client-bundle-example/src/index.html index b51781f642..d1f0c0f325 100644 --- a/demos/client-bundle-example/src/index.html +++ b/demos/client-bundle-example/src/index.html @@ -140,7 +140,7 @@