Skip to content

Commit

Permalink
Merge branch 'main' into github-release-override
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetso authored Nov 28, 2023
2 parents 10a4d3c + 7569a39 commit 5b9d1d8
Show file tree
Hide file tree
Showing 59 changed files with 580 additions and 527 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.rs'
- '.github/workflows/clippy.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/contract_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- '**/package.json'
- '**/Cargo.toml'
- '.github/workflows/contract_version.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependent-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
# issues or pull requests. Otherwise, it can be removed.
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
check:
Expand Down
56 changes: 20 additions & 36 deletions .github/workflows/dockerhub_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- 'package.json'
- '.github/workflows/dockerhub_publish.yml'
workflow_dispatch:
inputs:
ignore_version_check:
description: 'Ignore version check and publish anyway'
required: false
default: 'false'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -50,8 +55,7 @@ jobs:
- name: Install dependencies and build packages
# Install dependencies and build packages if either provider or JS bundle needs to be published
if: >-
needs.check_version.outputs.bump == 'true'
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
run: |
set -e # Exit immediately if a command exits with a non-zero status.
echo "Installing dependencies..."
Expand All @@ -62,15 +66,13 @@ jobs:
- name: Log in to Docker Hub
# Only log in if either provider or JS bundle needs to be published
if: >-
needs.check_version.outputs.bump == 'true'
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
run: |
echo "Logging into Docker Hub."
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin 2> /dev/null
- name: Build JS Bundle and Publish to Docker Hub
# Build JS bundle and publish to Docker Hub if publish_dockerhub_js_bundle is true
if: needs.check_version.outputs.bump == 'true'
- name: Build JS bundle and publish to Docker Hub
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
run: |
set -x # Print commands and their arguments as they are executed.
Expand All @@ -87,47 +89,29 @@ jobs:
NODE_ENV=production npm run bundle:prod
# Rename the bundle to include the version number
NEW_BUNDLE_FILENAME="procaptcha.bundle.${{ needs.check_version.outputs.next_version }}.js"
mv ./dist/bundle/procaptcha.bundle.js ./dist/bundle/$NEW_BUNDLE_FILENAME
# Navigate back to the project root
echo "Navigating back to project root..."
cd ../..
# Pull the latest Docker image
docker pull prosopo/js_server:${{needs.check_version.outputs.current_version}} || echo "No existing image found" && exit 1
docker pull prosopo/js_server:${{needs.check_version.outputs.current_version}}
# Create a temporary container from the latest image
echo "Building Docker image..."
CONTAINER_ID=$(docker create prosopo/js_server:${{needs.check_version.outputs.current_version}})
# Copy the entire bundle directory from the container to the host
docker cp $CONTAINER_ID:/usr/share/nginx/html/js/ ./js_bundles_host_temp/
# Copy the bundle to the container and rename it to include the version
docker cp ./dist/bundle/procaptcha.bundle.js $CONTAINER_ID:/usr/share/nginx/html/js/procaptcha.bundle.${{ needs.check_version.outputs.next_version }}.js
# Remove the temporary container
docker rm $CONTAINER_ID
# Copy the bundle to the container as the latest version, overwriting the existing bundle if one exists
docker cp ./dist/bundle/procaptcha.bundle.js $CONTAINER_ID:/usr/share/nginx/html/js/procaptcha.bundle.js
# Add the new bundle to the local js directory
cp ./packages/procaptcha-bundle/dist/bundle/$NEW_BUNDLE_FILENAME ./js_bundles_host_temp/
# Commit the changes to the container
docker commit $CONTAINER_ID prosopo/js_server:${{needs.check_version.outputs.next_version}}
# Remove ./js_bundles_host_temp/procaptcha.bundle.js if one already exists
rm -f ./js_bundles_host_temp/procaptcha.bundle.js
# Create a symlink named 'procaptcha.bundle.js' pointing to the new versioned bundle
ln -s $NEW_BUNDLE_FILENAME ./js_bundles_host_temp/procaptcha.bundle.js
# Build a new Docker image with the updated js directory
docker build --file ./docker/images/js.server.dockerfile . -t prosopo/js_server:${{needs.check_version.outputs.next_version}}
echo "Pushing Docker image for JS bundle..."
# Push the new image to Docker Hub
echo "Pushing Docker image..."
docker push prosopo/js_server:${{needs.check_version.outputs.next_version}}
# Cleanup: Remove the temporary js directory
rm -rf ./js_bundles_host_temp/
- name: Build and Push the Provider Bundle
# Build and push the provider bundle to Docker Hub if bump is true
if: needs.check_version.outputs.bump == 'true'
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
run: |
# Copy the rococo env file to production env file
echo "Copying the rococo env to production env file in cli package"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: lint
on:
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- 'package.json'
- '.github/workflows/npm_publish.yml'
workflow_dispatch:
inputs:
ignore_version_check:
description: 'Ignore version check and publish anyway'
required: false
default: 'false'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -55,7 +60,7 @@ jobs:
- run: npm run build:all:cjs

- name: Npm publish
if: needs.check_version.outputs.bump == 'true'
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
run: |
if [[ "${{ vars.HOST_GITHUB_ACTIONS }}" == true ]]; then
echo "Running on GitHub Actions"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/provider_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'packages/**'
- 'contracts/**'
- '.github/workflows/provider_image.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
workflow_dispatch:

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.rs'
- '.github/workflows/rustfmt.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'dev/**'
- 'contracts/**'
- '.github/workflows/tests.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests_protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- 'protocol/**'
- '.github/workflows/tests_protocol.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion contracts/captcha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/captcha-contract",
"version": "0.2.15",
"version": "0.2.16",
"description": "The captcha contract",
"main": "dist/index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions contracts/captcha/src/captcha.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x9f31f69e99501650815ba0a4f0a797397fa3a1de2fc11c343370dd36020b3e60",
"hash": "0xb0a01f0b919857ecf57257e14f8d0ccc72c2d89889fd595b6ea8e78976812dcd",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand All @@ -15,7 +15,7 @@
},
"contract": {
"name": "captcha",
"version": "0.2.15",
"version": "0.2.16",
"authors": [
"Chris Taylor <chris@prosopo.io>",
"George Oastler <george@prosopo.io>",
Expand Down
4 changes: 2 additions & 2 deletions contracts/captcha/src/contract-info/captcha.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/common-contract",
"version": "0.2.15",
"version": "0.2.16",
"description": "The common contract",
"main": "dist/index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions contracts/common/src/common.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x97847c4f29179f81130bca2ffcdf837fad469814ba728aa03f7fa92d294b446a",
"hash": "0xe32b8fb04eebb55c901ce14ec2e46164e97b2a7e89fb3592c5b3e1eaed3317b6",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand All @@ -15,7 +15,7 @@
},
"contract": {
"name": "common",
"version": "0.2.15",
"version": "0.2.16",
"authors": [
"Chris Taylor <chris@prosopo.io>",
"George Oastler <george@prosopo.io>",
Expand Down
4 changes: 2 additions & 2 deletions contracts/common/src/contract-info/common.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/proxy-contract",
"version": "0.2.15",
"version": "0.2.16",
"description": "The proxy contract",
"main": "dist/index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions contracts/proxy/src/contract-info/proxy.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contracts/proxy/src/proxy.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x79c812f7328e468314c16049f424605d9312f99b63c6947704b3008a5b81ec68",
"hash": "0xd6e8f97d66040d8bdae6fb8fd96e707810782728aedc4ca34a417e28039e4798",
"language": "ink! 4.3.0",
"compiler": "rustc 1.69.0",
"build_info": {
Expand All @@ -15,7 +15,7 @@
},
"contract": {
"name": "proxy",
"version": "0.2.15",
"version": "0.2.16",
"authors": ["Chris Taylor <chris@prosopo.io>", "George Oastler <george@prosopo.io>"]
},
"spec": {
Expand Down
6 changes: 3 additions & 3 deletions demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@prosopo/client-bundle-example",
"main": "index.js",
"engines": {
"node": ">=16",
"npm": "8.9"
"node": ">=18",
"npm": ">=9"
},
"scripts": {
"start": "light-server -s ./src -p 9232 -w \"**/*.html,**/*.css,**/*.js,**/*.gz\"",
Expand All @@ -13,7 +13,7 @@
"dotenv": "^16.0.1",
"light-server": "^2.9.1"
},
"version": "0.2.15",
"version": "0.2.16",
"devDependencies": {
"tslib": "2.6.2",
"typescript": "5.1.6"
Expand Down
18 changes: 9 additions & 9 deletions demos/client-example-server/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@prosopo/client-example-server",
"version": "0.2.15",
"version": "0.2.16",
"description": "Backend for client-example",
"main": "dist/app.js",
"type": "module",
"engines": {
"node": ">=16",
"npm": "8.9"
"node": ">=18",
"npm": ">=9"
},
"scripts": {
"dev": "vite serve --mode=development --config ./vite.config.ts --host",
Expand All @@ -33,11 +33,11 @@
"@noble/hashes": "^1.3.1",
"@polkadot/util": "12.5.1",
"@polkadot/util-crypto": "12.5.1",
"@prosopo/api": "0.2.15",
"@prosopo/contract": "0.2.15",
"@prosopo/procaptcha": "0.2.15",
"@prosopo/server": "0.2.15",
"@prosopo/types": "0.2.15",
"@prosopo/api": "0.2.16",
"@prosopo/contract": "0.2.16",
"@prosopo/procaptcha": "0.2.16",
"@prosopo/server": "0.2.16",
"@prosopo/types": "0.2.16",
"@typegoose/auto-increment": "3.3.0",
"cors": "^2.8.5",
"jsonwebtoken": "^9.0.0",
Expand All @@ -52,6 +52,6 @@
"tslib": "2.6.2",
"typescript": "5.1.6",
"vite": "^4.5.0",
"@prosopo/config": "0.2.15"
"@prosopo/config": "0.2.16"
}
}
18 changes: 9 additions & 9 deletions demos/client-example/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "@prosopo/client-example",
"version": "0.2.15",
"version": "0.2.16",
"private": true,
"type": "module",
"engines": {
"node": ">=16",
"npm": "8.9"
"node": ">=18",
"npm": ">=9"
},
"dependencies": {
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@mui/material": "^5.9.1",
"@prosopo/common": "0.2.15",
"@prosopo/procaptcha": "0.2.15",
"@prosopo/procaptcha-react": "0.2.15",
"@prosopo/types": "0.2.15",
"@prosopo/common": "0.2.16",
"@prosopo/procaptcha": "0.2.16",
"@prosopo/procaptcha-react": "0.2.16",
"@prosopo/types": "0.2.16",
"@types/react-dom": "^18.2.4",
"electron": "25.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@prosopo/cli": "0.2.15",
"@prosopo/config": "0.2.15",
"@prosopo/cli": "0.2.16",
"@prosopo/config": "0.2.16",
"@types/node": "^20.3.1",
"css-loader": "^6.8.1",
"eslint-config-react-app": "^7.0.1",
Expand Down
8 changes: 4 additions & 4 deletions demos/cypress-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@prosopo/cypress-shared",
"version": "0.2.15",
"version": "0.2.16",
"private": true,
"type": "module",
"engines": {
"node": ">=18",
"npm": "8.9"
"npm": ">=9"
},
"dependencies": {
"@prosopo/types": "0.2.15",
"@prosopo/util": "0.2.15"
"@prosopo/types": "0.2.16",
"@prosopo/util": "0.2.16"
},
"devDependencies": {
"@cypress/xpath": "^2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion demos/dapp-example/contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dapp"
version = "0.2.15"
version = "0.2.16"
authors = [ "Chris Taylor chris@prosopo.io" ]
edition = "2021"

Expand Down
Loading

0 comments on commit 5b9d1d8

Please sign in to comment.