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-22 13:39:45 +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-22 16:07:58 +00:00
|
|
|
working-directory: packages/fluence-js
|
|
|
|
run: pnpm i --save -E @fluencelabs/avm@${{ inputs.avm-version }}
|
|
|
|
|
|
|
|
- name: Set marine-js version
|
|
|
|
if: inputs.marine-js-version != ''
|
|
|
|
working-directory: packages/fluence-js
|
|
|
|
run: pnpm i --save -E @fluencelabs/marine-js@${{ inputs.marine-js-version }}
|
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-22 13:39:45 +00:00
|
|
|
id: snapshot
|
2022-09-06 14:51:43 +00:00
|
|
|
run: |
|
2022-11-22 13:39:45 +00:00
|
|
|
node ci.js bump-version ${{ steps.version.outputs.id }}
|
2022-10-31 15:10:22 +00:00
|
|
|
echo "version=$(node ci.js get-version)" >> $GITHUB_OUTPUT
|
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-22 13:39:45 +00:00
|
|
|
- name: Publish to self-hosted npm repo
|
2022-10-31 15:10:22 +00:00
|
|
|
run: |
|
2022-11-22 13:39:45 +00:00
|
|
|
# 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
|