fluence-js/.github/workflows/snapshot.yml

98 lines
2.7 KiB
YAML
Raw Normal View History

name: Publish snapshot
on:
workflow_call:
inputs:
avm-version:
description: "@fluencelabs/avm version"
type: string
marine-js-version:
description: "@fluencelabs/marine-js 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 != ''
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 }}
- 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 }}
2022-10-31 15:10:22 +00:00
echo "version=$(node ci.js get-version)" >> $GITHUB_OUTPUT
- run: pnpm -r build
- name: Publish to self-hosted npm repo
2022-10-31 15:10:22 +00:00
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