Merge pull request #168 from VWBL/fix/ci-id #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish npm package | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
env: | |
# Check available versions below | |
# https://github.com/actions/node-versions/blob/main/versions-manifest.json | |
node-version: "20.x" | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node-version }} | |
cache: 'npm' | |
- name: node_modules cache | |
uses: actions/cache@v2 | |
id: cache_node_modules | |
with: | |
# キャッシュキー完全一致しない場合 npm installする必要があるのでrestore-keysは使わない | |
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }} | |
path: '**/node_modules' | |
- name: Install Dependencies | |
if: steps.cache_node_modules.outputs.cache-hit != 'true' | |
run: npm install | |
publish-core-evm-xrpl: | |
if: contains(github.ref, 'tags/core') | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node-version }} | |
cache: 'npm' | |
- name: node_modules cache | |
uses: actions/cache@v2 | |
with: | |
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }} | |
path: '**/node_modules' | |
- name: Build | |
run: npm run build:all | |
- name: Check if vwbl-core package version can be published | |
uses: technote-space/package-version-check-action@v1 | |
with: | |
PACKAGE_DIR: 'packages/core/' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_MANAGER: npm | |
- name: Check if vwbl-sdk(evm chain) package version can be published | |
uses: technote-space/package-version-check-action@v1 | |
with: | |
PACKAGE_DIR: 'packages/evm/' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_MANAGER: npm | |
- name: Check if vwbl-sdk-xrpl package version can be published | |
uses: technote-space/package-version-check-action@v1 | |
with: | |
PACKAGE_DIR: 'packages/xrpl/' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_MANAGER: npm | |
- name: Publish vwbl-core package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc && npm run publish:core | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
- name: Publish vwbl-sdk(evm chain) package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc && npm run publish:evm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
- name: Publish vwbl-sdk-xrpl package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc && npm run publish:xrpl | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
publish-evm: | |
if: contains(github.ref, 'tags/evm') | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
id: setup-node | |
with: | |
node-version: ${{ env.node-version }} | |
cache: 'npm' | |
- name: node_modules cache | |
uses: actions/cache@v2 | |
with: | |
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }} | |
path: '**/node_modules' | |
- name: Build | |
run: npm run build:all | |
- name: Check if vwbl-sdk(evm chain) package version can be published | |
uses: technote-space/package-version-check-action@v1 | |
with: | |
PACKAGE_DIR: 'packages/evm/' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_MANAGER: npm | |
- name: Publish vwbl-sdk(evm chain) package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc && npm run publish:evm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
publish-xrpl: | |
if: contains(github.ref, 'tags/xrpl') | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node-version }} | |
cache: 'npm' | |
- name: node_modules cache | |
uses: actions/cache@v2 | |
with: | |
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }} | |
path: '**/node_modules' | |
- name: Build | |
run: npm run build:all | |
- name: Check if vwbl-sdk-xrpl package version can be published | |
uses: technote-space/package-version-check-action@v1 | |
with: | |
PACKAGE_DIR: 'packages/xrpl/' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_MANAGER: npm | |
- name: Publish vwbl-sdk-xrpl package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc && npm run publish:xrpl | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} |