Skip to content

Commit

Permalink
update publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pankaj-parashar committed Nov 8, 2023
1 parent a3b8bb0 commit e82b7ef
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9,247 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,29 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: https://registry.npmjs.org/

- 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
- name: Set Git Config
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: Install dependencies
run: npm install

- name: Build theme
run: npm run build

- name: Authenticate with NPM Registry
run: |
echo "registry=https://registry.npmjs.org/" >> .npmrc
Expand All @@ -55,10 +46,22 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}

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

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

- name: Bump version
id: bump_version
run: |
npm version patch -m "Bump version to %s"
- name: Publish to npm
run: |
npm publish --access public
git push origin HEAD:main
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
Loading

0 comments on commit e82b7ef

Please sign in to comment.