2022-09-06 14:51:43 +00:00
|
|
|
name: Publish snapshot
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
2022-09-13 16:24:20 +00:00
|
|
|
inputs:
|
|
|
|
avm-version:
|
|
|
|
description: "@fluencelabs/avm version"
|
|
|
|
type: string
|
2022-11-22 16:07:58 +00:00
|
|
|
marine-js-version:
|
|
|
|
description: "@fluencelabs/marine-js version"
|
|
|
|
type: string
|
2022-09-06 14:51:43 +00:00
|
|
|
outputs:
|
|
|
|
fluence-js-version:
|
2022-09-13 16:24:20 +00:00
|
|
|
description: "@fluencelabs/fluence version"
|
2022-09-06 14:51:43 +00:00
|
|
|
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:
|
2022-11-25 14:50:37 +00:00
|
|
|
fluence-js-version: "${{ steps.snapshot.outputs.version }}"
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout fluence-js
|
|
|
|
uses: actions/checkout@v3
|
2022-09-13 16:24:20 +00:00
|
|
|
with:
|
|
|
|
repository: fluencelabs/fluence-js
|
2022-09-06 14:51:43 +00:00
|
|
|
|
2022-11-22 13:39:45 +00:00
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
2022-09-06 14:51:43 +00:00
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
|
|
|
|
- name: Setup node with self-hosted npm registry
|
2022-09-13 16:24:20 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-09-06 14:51:43 +00:00
|
|
|
with:
|
|
|
|
node-version: "16"
|
|
|
|
registry-url: "https://npm.fluence.dev"
|
2022-09-13 16:24:20 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
2022-09-14 14:43:17 +00:00
|
|
|
- run: pnpm i
|
|
|
|
|
2022-11-22 13:39:45 +00:00
|
|
|
- name: Set avm version
|
2022-09-13 16:24:20 +00:00
|
|
|
if: inputs.avm-version != ''
|
2022-11-25 07:49:38 +00:00
|
|
|
uses: fluencelabs/github-actions/npm-set-dependency@main
|
|
|
|
with:
|
|
|
|
package: "@fluencelabs/avm"
|
|
|
|
version: ${{ inputs.avm-version }}
|
|
|
|
working-directory: packages/fluence-js
|
|
|
|
package-manager: pnpm
|
2022-11-22 16:07:58 +00:00
|
|
|
|
|
|
|
- name: Set marine-js version
|
|
|
|
if: inputs.marine-js-version != ''
|
2022-11-25 07:49:38 +00:00
|
|
|
uses: fluencelabs/github-actions/npm-set-dependency@main
|
|
|
|
with:
|
|
|
|
package: "@fluencelabs/marine-js"
|
|
|
|
version: ${{ inputs.marine-js-version }}
|
|
|
|
working-directory: packages/fluence-js
|
|
|
|
package-manager: pnpm
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
- name: Import secrets
|
2022-11-22 13:39:45 +00:00
|
|
|
uses: hashicorp/vault-action@v2.4.3
|
2022-09-06 14:51:43 +00:00
|
|
|
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
|
|
|
|
|
2022-11-22 13:39:45 +00:00
|
|
|
- name: Generate snapshot version
|
2022-09-06 14:51:43 +00:00
|
|
|
id: version
|
2022-11-22 13:39:45 +00:00
|
|
|
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
- name: Set package version
|
2022-11-25 07:49:38 +00:00
|
|
|
run: node ci.js bump-version ${{ steps.version.outputs.id }}
|
2022-09-06 14:51:43 +00:00
|
|
|
|
2022-11-22 13:39:45 +00:00
|
|
|
- run: pnpm -r build
|
2022-09-06 14:51:43 +00:00
|
|
|
|
2022-11-25 07:49:38 +00:00
|
|
|
- name: Publish snapshots
|
|
|
|
id: snapshot
|
2022-11-22 13:39:45 +00:00
|
|
|
uses: fluencelabs/github-actions/npm-publish-snapshot@main
|
|
|
|
with:
|
|
|
|
working-directory: packages/fluence-js
|
|
|
|
id: ${{ steps.version.outputs.id }}
|
2022-11-25 07:49:38 +00:00
|
|
|
package-manager: pnpm
|
|
|
|
flags: "-r --registry https://npm.fluence.dev --no-git-checks --tag snapsot -filter '@fluencelabs/*'"
|