Skip to content

Commit

Permalink
Merge pull request #11 from adobe/publish-workflow
Browse files Browse the repository at this point in the history
workflow for theme package publishing
  • Loading branch information
pankaj-parashar authored Oct 25, 2023
2 parents 962a6f7 + 25fe0ab commit 47e22f4
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish On NPMJS

on:
pull_request:
types:
- closed
branches:
- main

jobs:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm install

- name: Discard Uncommitted Changes
run: git reset --hard

- name: Build theme
run: npm run build

- name: Get current version
id: get_version
run: echo ::set-output name=version::$(node -p "require('./package.json').version")

- name: Config git
run: |
git config --global user.email "ci-build@aemforms"
git config --global user.name "ci-build"
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_GH_TOKEN }}
GH_TOKEN: ${{ secrets.ADOBE_GH_TOKEN }}

- name: Bump version
id: bump_version
run: |
npm version patch -m "Bump version to %s"
- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
npm publish --access public
git push origin HEAD:main
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}

0 comments on commit 47e22f4

Please sign in to comment.