Merge pull request #182 from gofynd/Fix-search-icon-v2-dialog #29
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
name: NPM Components Package Publish | |
on: | |
push: | |
branches: | |
- master-old | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
if: contains(github.event.head_commit.message, 'publish-npm') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.0.0] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Update Git Config | |
run: | | |
# Modify git config to add user name and email | |
git config user.name "Paul Lobo (Auto)" | |
git config user.email "[email protected]" | |
shell: bash | |
- name: Bump version | |
run: npm version patch | |
- name: Get new version | |
run: | | |
npm_version=$(node -p "require('./package.json').version") | |
echo "NPM_VERSION=$npm_version" >> $GITHUB_ENV | |
echo "New version: $npm_version" # Add this line to debug | |
- name: Get new version | |
run: echo "$NPM_VERSION" | |
- name: Install Dependencies | |
run: npm i | |
# - name: Update Dependencies | |
# run: npm install --legacy-peer-deps | |
- name: List Files | |
run: ls -R | |
- name: Build Package | |
run: npm run build-bundle | |
- name: Login to npm | |
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Publish Package | |
run: npm publish | |
- name: Set Remote URL | |
run: | | |
git remote set-url origin https://github.com/${{ github.repository }}.git | |
- name: Sync changes | |
run: git pull | |
- name: Create new branch | |
run: git checkout -b pipeline---update | |
- name: Commit changes | |
run: | | |
git add . && git commit -m "[Auto] Publish changes to NPM ::: bump version to $(npm version patch)" | |
- name: Push changes to new branch | |
run: git push origin pipeline---update | |
- name: Create Pull Request | |
run: gh pr create --base master-old --head pipeline---update --title "Automated PR" --body "Auto Created by npm publish pipeline" | |
env: | |
GITHUB_TOKEN: ${{ secrets.NITROZEN-VUE-NPM-TOKEN }} | |
- name: Merge PR (optional) | |
run: gh pr merge pipeline---update --squash --delete-branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.NITROZEN-VUE-NPM-TOKEN }} | |