Skip to content

Commit

Permalink
Merge branch 'main' into drop-mui
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetso committed Dec 12, 2023
2 parents 6c4cc31 + 99c4743 commit f1f56ae
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ on:
- main
# or run manually
workflow_dispatch:
inputs:
# ignore the version check and publish anyway
ignore_version_check:
type: boolean
description: 'Ignore the version check and publish anyway'
required: false
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -47,6 +54,11 @@ jobs:
echo "version bump detected"
echo "bump=true" >> $GITHUB_OUTPUT
fi
if [[ "${{ github.event.inputs.ignore_version_check }}" == true ]]; then
echo "ignoring version check"
echo "bump=true" >> $GITHUB_OUTPUT
fi
echo "GITHUB_OUTPUT=$GITHUB_OUTPUT"
# setup node
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -83,19 +95,20 @@ jobs:
- run: ls -la node_modules || true

- name: Log in to Docker Hub
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
echo "Logging into Docker Hub."
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin 2> /dev/null
# install
- run: npm install
- run: npm run removePolkadotJSWarnings
- name: Install
run: |
npm install
npm run removePolkadotJSWarnings
# at this point there should be a build in the cache, so we can begin building artifacts for the release

- name: Install dependencies and build packages
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
echo "Installing dependencies..."
npm ci
Expand All @@ -104,15 +117,15 @@ jobs:
npm run build:all:cjs
- name: Build the contract sources
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
cd protocol/dev
npm run build
npm run cli -- clean --docker
npm run cli -- build --docker --release
- name: Build JS bundle
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
# Copy the rococo env file to production env file
echo "Copying the rococo env to production env file in procaptcha-bundle"
Expand All @@ -132,7 +145,7 @@ jobs:
gh release create --generate-notes "v${{ steps.check_version.outputs.next_version }}" "./protocol/target/ink/captcha/captcha.contract" "./protocol/target/ink/proxy/proxy.contract" "./packages/procaptcha-bundle/dist/bundle/procaptcha.bundle.js"
- name: Npm publish
if: needs.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
if [[ "${{ vars.HOST_GITHUB_ACTIONS }}" == true ]]; then
echo "Running on GitHub Actions"
Expand All @@ -147,7 +160,7 @@ jobs:
fi
- name: Publish bundle in js_server to dockerhub
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == 'true'
run: |
# Pull the latest Docker image
docker pull prosopo/js_server:${{steps.check_version.outputs.current_version}}
Expand All @@ -171,7 +184,7 @@ jobs:
- name: Build and Push the Provider Bundle
# Build and push the provider bundle to Docker Hub if bump is true
if: steps.check_version.outputs.bump == 'true' || ${{ github.event.inputs.ignore_version_check }} == 'true'
if: steps.check_version.outputs.bump == '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

0 comments on commit f1f56ae

Please sign in to comment.