Skip to content

Merge pull request #316 from TokenScript/upgrade/eas-v1-offchain-support #169

Merge pull request #316 from TokenScript/upgrade/eas-v1-offchain-support

Merge pull request #316 from TokenScript/upgrade/eas-v1-offchain-support #169

Workflow file for this run

name: "JS CI"
on:
push:
branches:
- main
- stage
paths:
- "src/main/javascript/crypto/**"
pull_request:
branches:
- main
- stage
paths:
- "src/main/javascript/crypto/**"
workflow_dispatch:
inputs:
snapshot_version:
description: "A custom version to use for the snapshot package"
required: false
default: false
type: string
jobs:
js-p1:
uses: ./.github/workflows/js-p1.yml
prerelease:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/stage'
runs-on: ubuntu-latest
needs:
- js-p1
outputs:
version: ${{ steps.publish.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://npm.pkg.github.com"
- uses: actions/delete-package-versions@v3
with:
package-name: "attestation"
min-versions-to-keep: 3
- uses: actions/download-artifact@v3
with:
name: js-build
path: src/main/javascript/crypto/dist/
- name: publish
id: publish
run: |
cd src/main/javascript/crypto/
# Only use hash when version isn't explicitly specified
if [ -n "${ATTESTATION_VER}" ]; then
SHORT_SHA="${GITHUB_SHA:0:7}"
SNAPSHOT_VERSION="SNAPSHOT-staging.${SHORT_SHA}"
fi;
sed -ri "s/\"version\"\s*:\s*\"(.*)\"/\"version\": \"\1-${SNAPSHOT_VERSION}\"/" package.json
cat package.json
npm i
npm publish --tag SNAPSHOT-staging --access restricted
version="$(node -e 'console.log(require("./package.json").version)')"
echo "version=${version}" >>$GITHUB_OUTPUT
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPSHOT_VERSION: ${{ inputs.snapshot_version }}
downstream-attestation_id-ci:
needs:
- prerelease
runs-on: ubuntu-latest
steps:
- name: Trigger Downstream CI
uses: convictional/[email protected]
with:
owner: AlphaWallet
repo: attestation.id
github_token: ${{ secrets.PERSONAL_TOKEN }}
workflow_file_name: frontend-p1.yml
client_payload: '{ "attestation_ver": "${{ needs.prerelease.outputs.version }}", "use_github_packages": "true" }'
downstream-token-negotiator-ci:
needs:
- prerelease
runs-on: ubuntu-latest
steps:
- name: Trigger Downstream CI
uses: convictional/[email protected]
with:
owner: TokenScript
repo: token-negotiator
github_token: ${{ secrets.PERSONAL_TOKEN }}
workflow_file_name: tn-p1.yml
client_payload: '{ "attestation_ver": "${{ needs.prerelease.outputs.version }}", "use_github_packages": "true" }'