name: Publish snapshot on: workflow_call: inputs: avm-version: description: "@fluencelabs/avm version" type: string outputs: fluence-js-version: description: "@fluencelabs/fluence version" value: ${{ jobs.publish-snapshot.outputs.fluence-js-version }} env: FORCE_COLOR: true CI: true jobs: publish-snapshot: name: "Publish snapshot" runs-on: ubuntu-latest outputs: fluence-js-version: "${{ steps.snapshot.outputs.version }}" permissions: contents: read id-token: write steps: - name: Checkout fluence-js uses: actions/checkout@v3 with: repository: fluencelabs/fluence-js - uses: pnpm/action-setup@v2.2.4 with: version: 7 - name: Setup node with self-hosted npm registry uses: actions/setup-node@v3 with: node-version: "16" registry-url: "https://npm.fluence.dev" cache: "pnpm" - run: pnpm i - name: Set avm version if: inputs.avm-version != '' uses: fluencelabs/github-actions/npm-set-dependency@main with: package: "@fluencelabs/avm" version: ${{ inputs.avm-version }} working-directory: packages/fluence-js - name: Import secrets uses: hashicorp/vault-action@v2.4.3 with: url: https://vault.fluence.dev path: jwt/github role: ci method: jwt jwtGithubAudience: "https://github.com/fluencelabs" jwtTtl: 300 exportToken: false secrets: | kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN - name: Generate snapshot version id: version uses: fluencelabs/github-actions/generate-snapshot-id@main - name: Set package version id: snapshot run: | node ci.js bump-version ${{ steps.version.outputs.id }} echo "version=$(node ci.js get-version)" >> $GITHUB_OUTPUT - run: pnpm -r build - name: Publish to self-hosted npm repo run: | # Publish to self-hosted npm repo pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag snapshot -filter '@fluencelabs/*' - name: Print info to check summary uses: fluencelabs/github-actions/npm-publish-snapshot@main with: working-directory: packages/fluence-js id: ${{ steps.version.outputs.id }} publish: false