Fix: Actions github #689
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
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 | |
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 }} |