Skip to content

Fix: Actions github #695

Fix: Actions github

Fix: Actions github #695

Workflow file for this run

on:
pull_request:
branches:
- master
- development
jobs:
build-and-publish:
name: Build Jopi & Publish New Version in NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Configure git credentials
uses: OleksiyRudenko/gha-git-credentials@v2-latest
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Installing node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Installing yarn
run: |
yarn install
# - name: Set Current Version
# run: |
# CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
# echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Run tests
run: yarn test
- name: Run coverage
run: yarn jest --coverage
- name: Build Jopi
run: yarn build
- name: Set Git config
run: |
git config --global user.email "${{secrets.GIT_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER}}"
- name: Update lerna packages
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd node_modules/.bin
yarn lerna publish --yes --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}
# lerna version patch --yes
- name: Publish New Jopi version to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx lerna publish from-package --yes
merge-me:
name: Merge to master
needs:
- build-and-publish
runs-on: ubuntu-latest
steps:
- name: Merge me!
uses: ridedott/merge-me-action@master
with:
# This must be used as GitHub Actions token does not support
# pushing to protected branches.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}