fluence-js/.github/workflows/snapshot.yml
2024-02-23 17:09:25 +07:00

95 lines
2.4 KiB
YAML

name: Publish snapshot
on:
workflow_call:
inputs:
avm-version:
description: "@fluencelabs/avm version"
type: string
default: "null"
marine-js-version:
description: "@fluencelabs/marine-js version"
type: string
default: "null"
ref:
description: "git ref to checkout to"
type: string
default: "main"
outputs:
js-client-snapshots:
description: "js-client snapshots"
value: ${{ jobs.publish-snapshot.outputs.snapshots }}
env:
FORCE_COLOR: true
CI: true
jobs:
publish-snapshot:
name: "Publish snapshot"
runs-on: builder
outputs:
snapshots: "${{ steps.snapshot.outputs.snapshots }}"
permissions:
contents: read
id-token: write
steps:
- name: Checkout js-client
uses: actions/checkout@v3
with:
repository: fluencelabs/js-client
ref: ${{ inputs.ref }}
- uses: pnpm/action-setup@v2.2.4
with:
version: 8
- 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"
- name: Override dependencies
uses: fluencelabs/github-actions/pnpm-set-dependency@main
with:
dependencies: |
{
"@fluencelabs/avm": "${{ inputs.avm-version }}",
"@fluencelabs/marine-js": "${{ inputs.marine-js-version }}"
}
- run: pnpm -r --no-frozen-lockfile i
- 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
run: node ci.cjs bump-version ${{ steps.version.outputs.id }}
- run: pnpm -r build
- name: Publish snapshots
id: snapshot
uses: fluencelabs/github-actions/pnpm-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}
set-version: false