Skip to content

[ON_PUSH fsm-shell] 518b3c3f1eb46b22279217844497696075e7de86 #10

[ON_PUSH fsm-shell] 518b3c3f1eb46b22279217844497696075e7de86

[ON_PUSH fsm-shell] 518b3c3f1eb46b22279217844497696075e7de86 #10

Workflow file for this run

name: fsm-shell push
run-name: '[ON_PUSH fsm-shell] ${{ github.sha }}'
on:
pull_request:
branches: [master]
jobs:
ensure-mandatory-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
env:
REQUIRED_FILES: CHANGELOG.md package.json package-lock.json
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
FILES_CHANGED=$(git diff --diff-filter='AMTCR' --name-only origin/master HEAD | tr '[:upper:]' '[:lower:]')
echo $FILES_CHANGED
array=( $REQUIRED_FILES )
missing_files=""
for i in "${array[@]}"
do
[[ ${FILES_CHANGED[*]} =~ $i ]] && echo "$i file found in the changeset" || missing_files="$missing_files $i"
done
echo ""
[ -z "$missing_files" ] && echo "All mandatory files have been modified" || echo "Following files $missing_files have not been modified"
[ -z "$missing_files" ] && exit 0 || exit 1
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm i
- name: Unit tests
run: npm run test:ci:headless
publish:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm i
- name: Run build
run: npm run build
- name: Prepare files
run: |
mkdir npm_public
mv release package.json package-lock.json npm_public
cd npm_public
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc
- name: Publish
run: |
cd npm_public
npm publish