Skip to content

Update branch sync in publish-conversion.yml and publish-gen.yml work… #3

Update branch sync in publish-conversion.yml and publish-gen.yml work…

Update branch sync in publish-conversion.yml and publish-gen.yml work… #3

name: Publish Document Conversion NPM Package
on:
push:
branches: [ "main" ]
permissions:
contents: write
packages: write
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://npm.pkg.github.com'
scope: '@universityofnicosia'
- name: Install dependencies
run: npm install
working-directory: privateomega-lib/
- name: Publish package
id: publish
run: npm publish
working-directory: privateomega-lib/
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Increment package version
if: steps.publish.outcome == 'failure'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git pull origin
npm version patch
git add .
git commit -m "chore: bump version [skip ci]"
git pull origin
git push
working-directory: privateomega-lib/
- name: Publish package again
if: steps.publish.outcome == 'failure'
run: npm publish
working-directory: privateomega-lib/
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}