Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Merge pull request #44 from SaitoTech/develop #49

Merge pull request #44 from SaitoTech/develop

Merge pull request #44 from SaitoTech/develop #49

Workflow file for this run

name: publish
on:
push:
branches: [ master ]
# pull_request:
# branches: [ develop, master ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/Checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
cache: npm
# cache-dependency-path: saito-wasm/package-lock.json
- name: get latest version
run: |
echo latest_version=$(npm show saito-js version) >> $GITHUB_ENV
echo current_version=$(npm pkg get version) >> $GITHUB_ENV
# working-directory: saito-wasm
- name: version check
if: ${{ env.latest_version == env.current_version }}
run: |
echo "same version is already published"
echo "current version : ${{ env.current_version }}"
echo "published version : ${{ env.latest_version }}"
- name: Install npm packages
if: ${{ env.latest_version != env.current_version }}
run: npm ci
# working-directory: saito-wasm
- name: build
if: ${{ env.latest_version != env.current_version }}
run: npm run build
- name: copying
if: ${{ env.latest_version != env.current_version }}
run: |
cp package.json dist
cp package-lock.json dist
cp tsconfig.json dist
cp .npmignore dist
- name: Publish package
if: ${{ env.latest_version != env.current_version }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: dist