Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.1.1 #1400

Merged
merged 322 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
322 commits
Select commit Hold shift + click to select a range
1fa1787
Cypress tests passing
HughParry Aug 6, 2024
f802200
stop the provider workflow from falling over if the npm packages are …
forgetso Aug 6, 2024
1e3ae78
Only load the provider mock container if we built it
forgetso Aug 6, 2024
b68f60c
Try to upload screenshots
forgetso Aug 6, 2024
ca04b68
Try to store screenshots on failure
forgetso Aug 6, 2024
a61368f
Try using withinSubject:null
forgetso Aug 6, 2024
2ec1fe4
Wait for button to be visible
forgetso Aug 6, 2024
34f547c
Wait for the the API call
forgetso Aug 6, 2024
844783c
Remove wait for solution request
forgetso Aug 6, 2024
0d1d924
try to force the click
forgetso Aug 6, 2024
dc74abb
Just force, don't expect the element
forgetso Aug 6, 2024
bf2f2fe
try waiting after clicking
forgetso Aug 6, 2024
61befa1
Store videos of cypress runs
forgetso Aug 6, 2024
bed1ba6
Remove the then
forgetso Aug 6, 2024
8e9e149
Remove duplicate click
forgetso Aug 6, 2024
858d126
Fix function return type
forgetso Aug 6, 2024
82a2fec
try within
forgetso Aug 6, 2024
ddd95c3
Adding setup step for setup env in test
HughParry Aug 7, 2024
a6d7298
Add data-cy attributes if environment is not production
forgetso Aug 7, 2024
a904c21
wait for docker containers to setup env
HughParry Aug 7, 2024
44efdbc
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
forgetso Aug 7, 2024
51cfce2
Adding setup step for setup env in test
HughParry Aug 7, 2024
7282e1c
Start docker first
forgetso Aug 7, 2024
bc4d19f
Check if there are references
forgetso Aug 7, 2024
6ed8217
remove within
forgetso Aug 7, 2024
b4152cc
Try to kill processes with concurrently
forgetso Aug 7, 2024
d0d987f
Size fixes for widget and logo
forgetso Aug 7, 2024
1af2dd4
Make signature stuff less confusing
forgetso Aug 8, 2024
62ac3b4
Fix license header positions
forgetso Aug 8, 2024
edf4536
Fix tests
forgetso Aug 8, 2024
3a83cdf
Get it all working
forgetso Aug 8, 2024
581662d
Merge branch 'staging' into size-fixes
forgetso Aug 8, 2024
d8a5ecf
Fix size
forgetso Aug 8, 2024
6e938a6
Fix lint issues (#1318)
goastler Aug 9, 2024
fe99949
use package workspaces rather than cd'ing (#1321)
goastler Aug 9, 2024
7f5caf2
Add push to js branch again to get live staging bundle
forgetso Aug 11, 2024
1b115ce
Remove any existing procaptcha responses on human
forgetso Aug 11, 2024
8eed75c
deploy staging on push to staging
forgetso Aug 12, 2024
89ce6bf
Use duplicate JS Server for now
forgetso Aug 12, 2024
669f6e7
Silence GH warning about NoSQL injection in demo
forgetso Aug 12, 2024
9beaa38
Silence GH warning about NoSQL injection in demo
forgetso Aug 12, 2024
8b7563e
Set GH_TOKEN env
forgetso Aug 12, 2024
fc0e4a7
Remove production step for JS Server
forgetso Aug 12, 2024
50013d1
Add back command to push to js-bundle branch. Remove quotes in asset …
forgetso Aug 12, 2024
514164a
Use correct docker tag
forgetso Aug 12, 2024
a6f22a7
Try moving to its own step
forgetso Aug 12, 2024
0035f24
don't fail if nothing to commit
forgetso Aug 12, 2024
806dbff
Update provider docker run CMD
forgetso Aug 12, 2024
b92dbd1
Always pull new version of tag for provider image
forgetso Aug 12, 2024
400c5a9
Update provider CMD
forgetso Aug 12, 2024
3f033a0
Alter the verify endpoint when in non-production environments in clie…
forgetso Aug 12, 2024
4f58e79
Allow PoW captchas to be stored and counted
forgetso Aug 13, 2024
4a1258c
Removing exportData from Manager
HughParry Aug 13, 2024
81dde17
Adding synamic config for load balancer
HughParry Aug 13, 2024
4b949d8
Fix build
forgetso Aug 13, 2024
7a75dc4
fix server build
forgetso Aug 13, 2024
4ce946a
fix server again
forgetso Aug 13, 2024
7918d9e
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
forgetso Aug 13, 2024
a127542
fix provider build
forgetso Aug 13, 2024
eb8a958
Merge branch 'staging' into release/2.0.0
forgetso Aug 13, 2024
25d4bd0
Removing dangerou
HughParry Aug 13, 2024
6ff6f25
Change scale-ts type to u64 to avoid losing data
forgetso Aug 13, 2024
0c287c5
revert change to number for timestamp
forgetso Aug 13, 2024
4e89de6
make sure procaptcha-response is deleted
forgetso Aug 13, 2024
2ce41a8
Fix scheduler database name and add env option for storage schedule
forgetso Aug 13, 2024
c0557d8
Make the models available once the connection has been made
forgetso Aug 13, 2024
1ab5169
Merge branch 'main' into staging
forgetso Aug 13, 2024
7665044
Merge branch 'staging' into size-fixes
forgetso Aug 14, 2024
3e0053a
Move headers
forgetso Aug 14, 2024
be85cd9
Update js_server release step
forgetso Aug 14, 2024
48eeeb1
Try using secret directly
forgetso Aug 14, 2024
b4daac5
Add some debug
forgetso Aug 14, 2024
8f26856
Modify debug
forgetso Aug 14, 2024
f639fad
Yet more debug
forgetso Aug 14, 2024
383c73f
I give up
forgetso Aug 14, 2024
5da691d
Working captcha results in mongo (#1322)
HughParry Aug 14, 2024
40d8d73
Use a var for mongo image
forgetso Aug 14, 2024
1c86647
more debug
forgetso Aug 14, 2024
cd33a71
Removing lint fix from version bump
HughParry Aug 14, 2024
54b953f
Merge branch 'main' into staging
forgetso Aug 19, 2024
5f35181
User data mvp (#1327)
forgetso Aug 21, 2024
15e1289
only run prosoponator on non-draft pr's (#1333)
goastler Aug 21, 2024
2a0a69e
fix dir capitalisation (#1329)
goastler Aug 21, 2024
8f1d57a
Introduce dotenv package for finding environment files (#1334)
forgetso Aug 21, 2024
4df38b8
Fix dataset IDs for staging providers
forgetso Aug 21, 2024
4aeab1e
Allow pow challenges to be submitted more than once for verification
forgetso Aug 21, 2024
02e3045
Fail if the challenge exists in the db
forgetso Aug 21, 2024
30bf49f
Revert unlimited challenge checking
forgetso Aug 21, 2024
eec7235
Make demo re-render captcha component when form changes
forgetso Aug 21, 2024
6d40870
Allow navigating between the captcha types
forgetso Aug 21, 2024
eee3867
Fix license location
forgetso Aug 21, 2024
ad05937
remove debug
forgetso Aug 21, 2024
095f595
Store something on each request. Update PoW types. Additional checks …
forgetso Aug 26, 2024
4feb72c
Bug fix for missing status in scheduled task record
forgetso Aug 26, 2024
da57633
Fix captcha storage mechanism. Add tests (#1337)
forgetso Aug 28, 2024
8104c93
use correct branch name in bump version
forgetso Aug 28, 2024
920fdfe
Merge branch 'main' into staging
forgetso Aug 28, 2024
f62ee80
Merge branch 'main' into staging
forgetso Aug 28, 2024
7a9ebb5
Merge branch 'main' into staging
forgetso Aug 28, 2024
a634f05
Merge branch 'main' into staging
forgetso Aug 28, 2024
973a9ca
Merge branch 'main' into staging
forgetso Aug 28, 2024
279a3cc
Merge branch 'main' into staging
forgetso Aug 29, 2024
3bf8166
Merge branch 'main' into staging
forgetso Aug 31, 2024
7f7a89d
Fix captcha scheduling insert (#1341)
forgetso Sep 2, 2024
7c5ebb0
Add types to tests to filter by test type during testing (#1342)
goastler Sep 2, 2024
a4e43b5
Fix last scheduled task getter (#1346)
forgetso Sep 3, 2024
57cbb09
Merge branch 'main' into staging
forgetso Sep 3, 2024
2ca87bb
Lint repo (#1349)
HughParry Sep 5, 2024
6203add
Docker compose overhaul (#1350)
goastler Sep 10, 2024
835e37f
Caddyfile defaults (#1352)
goastler Sep 11, 2024
79c2437
rimraf dep (#1331)
goastler Sep 11, 2024
e58539c
security policy (#1343)
goastler Sep 11, 2024
31988de
Portal settings (#1351)
forgetso Sep 11, 2024
18e351e
TLS headers (#1353)
goastler Sep 11, 2024
ec0d1af
remove old demo/example pkgs (#1345)
goastler Sep 11, 2024
7a24598
Provider retry (#1348)
HughParry Sep 11, 2024
130c70e
remove find-up (#1354)
forgetso Sep 12, 2024
d911587
Stop npm from failing on extraneous packages
forgetso Sep 12, 2024
7cc65a2
Add package-lock-only flag
forgetso Sep 12, 2024
0a7e42f
drop depends
goastler Sep 12, 2024
b24c1f4
Merge branch 'staging' of github.com:prosopo/captcha into staging
goastler Sep 12, 2024
83cfb71
Basic site key restrictions and scoring checks
forgetso Sep 12, 2024
862e0ca
site key registration in pow integration tests
forgetso Sep 12, 2024
c594dd8
Merge branch 'staging' into activated-accounts-only
forgetso Sep 12, 2024
a4ea455
get integration tests working
forgetso Sep 12, 2024
b4db259
don't double negative
forgetso Sep 12, 2024
ee9be45
Move error
forgetso Sep 13, 2024
5626753
link to FAQ when an error shows
forgetso Sep 13, 2024
1c9ffa6
Make score optional
forgetso Sep 13, 2024
5367915
lint-fix
forgetso Sep 13, 2024
b69ed44
Lint-fix
forgetso Sep 14, 2024
ebad311
Run admin api in cypress tests
forgetso Sep 14, 2024
f448b7a
pass timestamps in auth middleware tests
forgetso Sep 14, 2024
4403820
Deps (#1356)
goastler Sep 16, 2024
3cc4736
Deploy bundle on push (#1362)
HughParry Sep 16, 2024
b48522f
No hats (#1357)
goastler Sep 16, 2024
43dc049
npmrc (#1361)
goastler Sep 16, 2024
ffa2d2f
Adding prosopo to css selectors (#1363)
HughParry Sep 16, 2024
6a0e9c5
Deps (#1365)
goastler Sep 16, 2024
30a539b
npmrc fix (#1366)
goastler Sep 17, 2024
4d63776
bump vite to 5.4.6
forgetso Sep 17, 2024
7fc42d9
📦🔒
forgetso Sep 17, 2024
1e61dd5
fix bump version workflow (#1368)
goastler Sep 17, 2024
b7e3d67
saving to js folder (#1373)
HughParry Sep 18, 2024
d3b6b95
Adding spanish and portuguese support (#1364)
HughParry Sep 18, 2024
754cba9
recursive copy
forgetso Sep 18, 2024
0762bf7
caddyfile defaults for variables
goastler Sep 18, 2024
aea585b
Merge branch 'staging' of github.com:prosopo/captcha into staging
goastler Sep 18, 2024
2f39d6c
Copy top level files only
forgetso Sep 18, 2024
41c9efc
deploy fix (#1374)
HughParry Sep 18, 2024
6d0e187
Use inherited vite config from dev/config package (#1376)
forgetso Sep 19, 2024
78d37cf
i18n fixes (#1377)
HughParry Sep 19, 2024
cc7edf7
Portugese Brazilian (#1379)
forgetso Sep 19, 2024
282de5d
SBOM (#1360)
goastler Sep 19, 2024
1837427
remove c8 (#1370)
goastler Sep 20, 2024
bd97bd3
merge main into staging (#1385)
goastler Sep 20, 2024
06830ad
Remove score related stuff
forgetso Sep 20, 2024
304c6ce
Apply code scanning fix for information exposure through a stack trace
forgetso Sep 20, 2024
c0bfe32
Sort out test config
forgetso Sep 20, 2024
79e5a65
Don't send stacks via API
forgetso Sep 20, 2024
2eae2b6
target hosted version of mongodb docker image (#1386)
goastler Sep 20, 2024
cab9fa6
Merge branch 'staging' into activated-accounts-only
forgetso Sep 20, 2024
97673f5
lint-fix
forgetso Sep 20, 2024
98fb634
Remove argument level
forgetso Sep 20, 2024
32aaa26
Add command to start provider with admin api
forgetso Sep 20, 2024
96a3f4d
Change command to work with concurrently
forgetso Sep 20, 2024
c9960a9
Npm cache (#1382)
goastler Sep 20, 2024
e1e7283
Update correct workflow
forgetso Sep 20, 2024
aba8672
Merge branch 'staging' into activated-accounts-only
forgetso Sep 20, 2024
d112c2c
Move imports
forgetso Sep 20, 2024
fe3f1f2
📦🔒
forgetso Sep 20, 2024
9dce7c2
lint-fix
forgetso Sep 21, 2024
817aa27
Bundle docs URL
forgetso Sep 21, 2024
df49837
drop dependent issues (#1388)
goastler Sep 23, 2024
4a77005
standardise gha env vars (#1387)
goastler Sep 23, 2024
ad59289
Move translation strings
forgetso Sep 23, 2024
1d3d1f1
Add test to catch translation keys missing
forgetso Sep 23, 2024
5c4ace9
Merge branch 'staging' into activated-accounts-only
forgetso Sep 23, 2024
2263bcd
Fix bump version workflow (#1381)
goastler Sep 23, 2024
1f7b648
remove automerge (#1383)
goastler Sep 23, 2024
60e9c00
Big locale overhaul
forgetso Sep 23, 2024
ed026a3
Big locale overhaul
forgetso Sep 23, 2024
8b29639
📦🔒
forgetso Sep 23, 2024
38a6b44
📦🔒
forgetso Sep 23, 2024
f5b29bd
📦🔒
forgetso Sep 23, 2024
d609ee6
tsconfig refs
forgetso Sep 23, 2024
93c96d5
📦🔒
forgetso Sep 23, 2024
cf93f5b
remove polkadot/util from common
forgetso Sep 23, 2024
d08fd29
Use correct package name
forgetso Sep 23, 2024
4856fa6
Use correct package name
forgetso Sep 23, 2024
12af1b8
lint-fix
forgetso Sep 23, 2024
c8efb92
package dir getters
forgetso Sep 23, 2024
a48e47c
Lint-fix and fix import
forgetso Sep 23, 2024
d7c5886
Address PR comments
forgetso Sep 23, 2024
3c47f57
specify no tests for the locale-browser package
forgetso Sep 23, 2024
a3431f3
More imports placed below license
forgetso Sep 23, 2024
20cf36a
Fix merge
forgetso Sep 23, 2024
d40f0d6
Lint-fix
forgetso Sep 23, 2024
8373200
combine event workflows into single workflow with payload (#1389)
goastler Sep 23, 2024
24ada94
Merge branch 'staging' into locale-overhaul
forgetso Sep 23, 2024
e991c8c
Merge branch 'locale-overhaul' into activated-accounts-only
forgetso Sep 23, 2024
d061a90
Locale overhaul (#1393)
forgetso Sep 23, 2024
2d707c2
Merge branch 'staging' into activated-accounts-only
forgetso Sep 23, 2024
c80a948
ignore dirs
forgetso Sep 24, 2024
04e96f4
Fix find env getter
forgetso Sep 24, 2024
b682383
Remove caddy linting
forgetso Sep 24, 2024
bd9179d
Disable all non-essential linters
forgetso Sep 24, 2024
3bae3c1
Merge branch 'staging' into activated-accounts-only
forgetso Sep 24, 2024
a2f3cc2
Release workflow (#1390)
goastler Sep 24, 2024
24cc297
Bump ver workflow node/npm (#1396)
goastler Sep 24, 2024
437c6e6
Merge branch 'staging' into activated-accounts-only
forgetso Sep 24, 2024
2de7c2c
Bump version to 2.1.1
prosoponator Sep 24, 2024
58f5255
remove rogue npmignore
forgetso Sep 24, 2024
cbeb798
release/2.1.1
forgetso Sep 24, 2024
0392a7a
Commit main into release branch in bump_version
forgetso Sep 24, 2024
b412853
Merge branch 'staging' into activated-accounts-only
forgetso Sep 24, 2024
f69c8e4
Get origin/main before merging
forgetso Sep 24, 2024
3e16f1a
Merge branch 'staging' into activated-accounts-only
forgetso Sep 24, 2024
26efe78
Release/2.1.1 merge main (#1398)
forgetso Sep 24, 2024
1e251db
Remove main merge section
forgetso Sep 24, 2024
3f98dc1
Use unique IDs
forgetso Sep 24, 2024
9b698b7
Bump version to 2.1.1
prosoponator Sep 24, 2024
346cdf5
Merge branch 'release/2.1.1' of github.com:prosopo/captcha into relea…
forgetso Sep 24, 2024
0feb821
lint-fix
forgetso Sep 24, 2024
d8e1704
Remove unused import
forgetso Sep 24, 2024
84f5dc9
bump versions to 2.1.1
forgetso Sep 24, 2024
a980c77
remove dupe section
forgetso Sep 24, 2024
d2b629a
remove rogue deploy script
forgetso Sep 24, 2024
290fe1e
adjust gh release workflow
goastler Sep 24, 2024
eaf46ff
Version checker (#1402)
goastler Sep 24, 2024
01234a6
Fix docker container up/down in workflows (#1401)
goastler Sep 24, 2024
1b221fc
skip cache on self hosted runners (#1399)
goastler Sep 24, 2024
1c7d75c
remove check version bump (#1405)
goastler Sep 24, 2024
ec2b9ac
remove ci image from workflows (#1404)
goastler Sep 24, 2024
d7c00bb
default shell in workflows (#1406)
goastler Sep 24, 2024
bf3ea61
Tsconfig/nvmrc/engines/version linting (#1407)
goastler Sep 25, 2024
0fddf97
Merge branch 'staging' into release/2.1.1
forgetso Sep 25, 2024
4b1ff9a
Add missing cjs build commands
forgetso Sep 25, 2024
2b282e1
Remove cjs stuff where its not needed
forgetso Sep 25, 2024
e945fc9
remove another CJS build command
forgetso Sep 25, 2024
f6f5a12
lint-fix
forgetso Sep 25, 2024
fb7f391
Copy the correct env value over to the .env file
forgetso Sep 25, 2024
d80b202
Add missing build:cjs commands
forgetso Sep 25, 2024
5ccc16e
Fix tsconfigs + ignore dev/config pkg (#1408)
goastler Sep 25, 2024
bc570c1
Add missing build:cjs commands
forgetso Sep 25, 2024
ef205bc
Add CJS config for detector
forgetso Sep 25, 2024
684af70
lint-fix
forgetso Sep 25, 2024
4e01e46
make build:cjs optional (#1414)
goastler Sep 25, 2024
eda36e3
bug fix: diverging user accounts
forgetso Sep 26, 2024
5fe5026
Ignore docs when linting
forgetso Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/auto_merge.yml

This file was deleted.

55 changes: 50 additions & 5 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
GH_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
CARGO_TERM_COLOR: always
NODE_OPTIONS: "--max-old-space-size=4096"

defaults:
run:
shell: bash

jobs:
bump_version:
Expand Down Expand Up @@ -76,9 +83,32 @@ jobs:

- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress

- name: Restore npm cache
if: ${{ runner.environment != 'self-hosted' }} # don't restore cache on self-hosted runners, network speed not good enough
uses: actions/cache/restore@v3
with:
# must restore all cache dirs, and they must exist ahead of this!
path: |
~/.npm
~/.cache/Cypress
# note that restoring a cache in github is a pain. The trailing '-' matches any string after the '-', therefore 'abc-' would match a cache named 'abc-1234' or 'abc-5678', etc.
# the problem is 'abc-' will not match a cache named 'abc'! So if you're using wildcard cache name selectors like this, you need a field that changes as the suffix to become the wildcard
# here we're setting the key to an unused cache key so it falls back to the wildcard selector in `restore-keys`
key: some-unused-cache-key
restore-keys: |
npm-${{ runner.os }}-${{ runner.arch }}-

- name: Bump version
run: |
set -euxo pipefail # stop on errors, print commands, fail on pipe fails
set -euo pipefail # stop on errors, print commands, fail on pipe fails

# set the author in git
git config user.name "prosoponator[bot]"
Expand All @@ -97,17 +127,31 @@ jobs:
pkgJsons=$(npm run --silent ws:pkg)
pkgNames=$(npm run --silent ws:ls)
for pkgJson in $pkgJsons; do
echo "Bumping version in $pkgJson"
# for each package in the workspace, set the version number
cat $pkgJson | jq ".version = \"${{ github.event.inputs.version }}\"" > $pkgJson
cat $pkgJson | jq ".version = \"${{ github.event.inputs.version }}\"" > tmp
mv tmp $pkgJson
for pkgName in $pkgNames; do
# for each package in the workspace, check whether it is in the dependencies of the current package
# if so, bump the version number in the dependencies
cat $pkgJson | jq "if .dependencies[\"$pkgName\"] then .dependencies[\"$pkgName\"] = \"^${{ github.event.inputs.version }}\" else . end" > $pkgJson
cat $pkgJson | jq "if .dependencies[\"$pkgName\"] then .dependencies[\"$pkgName\"] = \"${{ github.event.inputs.version }}\" else . end" > tmp
mv tmp $pkgJson
cat $pkgJson | jq "if .devDependencies[\"$pkgName\"] then .devDependencies[\"$pkgName\"] = \"${{ github.event.inputs.version }}\" else . end" > tmp
mv tmp $pkgJson
done
done

# update pkg lock
# need to bump the PROSOPO_PACKAGE_VERSION variable in env files
envFiles=$(find . -iregex ".*\/\.?env\.[^js][^ts][^.d.ts]\w+" -not -path "./node_modules/**")
echo "Bumping version in env files: $envFiles"
for envFile in $envFiles; do
sed -i "s/PROSOPO_PACKAGE_VERSION=.*/PROSOPO_PACKAGE_VERSION=${{ github.event.inputs.version }}/g" $envFile
done

# the json may be poorly formatted now, so we need to fix it
npm i
npm run -w @prosopo/scripts build
npm run lint-fix

# commit the version changes
git add .
Expand All @@ -121,3 +165,4 @@ jobs:

# create a PR for the release
gh pr create --base ${{ github.event.inputs.dest }} --title "Release ${{ github.event.inputs.version }}" --fill

56 changes: 25 additions & 31 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ concurrency:
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
GH_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
CARGO_TERM_COLOR: always
GH_TOKEN: ${{ github.token }}
NODE_OPTIONS: "--max-old-space-size=4096"

defaults:
run:
shell: bash

jobs:
build:
Expand Down Expand Up @@ -59,10 +65,8 @@ jobs:

- uses: actions/checkout@v3

# make cache dirs
- run: mkdir -p protocol/cargo-cache
- run: mkdir -p protocol/target
- run: mkdir -p node_modules
# make cache dirs, these must exist before doing cache stuff
- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress

# don't restore the cache, otherwise we get artifacts left over from the previous run sit in the cache for eternity. Do a clean build every time.
Expand All @@ -77,38 +81,28 @@ jobs:
# install cypress so we don't have to do that every time
- run: npx cypress install

- run: ls -la ~/.cache/Cypress || true
- run: ls -la protocol/cargo-cache || true
- run: ls -la protocol/target/ink || true
- run: ls -la node_modules || true

# save cache to main branch. Any branch can use this cache afterwards to speed up their build
- name: Save cache
- name: Save npm cache
uses: actions/cache/save@v3
if: always()
with:
path: |
protocol/cargo-cache
protocol/target
node_modules
~/.cache/Cypress
key: project-cache-${{ github.event.pull_request.head.ref || github.ref }}-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}
~/.npm
~/.cache/Cypress
key: npm-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}

# remove all but the latest cache, leaving only the cache we just saved
- name: Cleanup caches
- name: Cleanup npm caches
if: always()
env:
REF: ${{ github.event.pull_request.head.ref || github.ref }}
run: |
set -euxo pipefail # stop on errors, print commands, fail on pipe fails

set +e; gh extension install actions/gh-actions-cache; set -e
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list --sort created-at --order desc --limit 100 -R "${{ github.repository }}" --key "project-cache-$REF-${{ runner.os }}-${{ runner.arch }}-" | cut -f 1 | tail -n +3)
echo caches to be removed:
echo "${cacheKeys}"
set +e
for cacheKey in $cacheKeys
do
gh actions-cache delete "$cacheKey" -R "${{ github.repository }}" --confirm
done
# remove all but the latest cache, leaving only the cache we just saved
set +e; gh extension install actions/gh-actions-cache; set -e
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list --sort created-at --order desc --limit 100 -R "${{ github.repository }}" --key "npm-${{ runner.os }}-${{ runner.arch }}-" | cut -f 1 | tail -n +3)
echo caches to be removed:
echo "${cacheKeys}"
set +e
for cacheKey in $cacheKeys
do
gh actions-cache delete "$cacheKey" -R "${{ github.repository }}" --confirm
done
99 changes: 0 additions & 99 deletions .github/workflows/check_version_bump.yml

This file was deleted.

Loading
Loading