update workflow #7
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_publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
bump_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: gh-action-bump-version | |
uses: "phips28/gh-action-bump-version@master" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
minor-wording: "MINOR" | |
major-wording: "MAJOR" | |
patch-wording: "PATCH" | |
target-branch: "main" | |
- name: set output | |
# run: echo "::set-output name=commit_sha::$(git rev-parse HEAD)" | |
run: echo "commit_sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT" | |
- name: for Test | |
run: echo "${{needs.bump_version.outputs.commit_sha}}}}" | |
npm_publish: | |
needs: [bump_version] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare | |
run: | | |
echo "this is for Test ${{needs.bump_version.outputs.commit_sha}}}}" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{needs.bump_version.outputs.commit_sha}} | |
- name: Install dependencies | |
run: npm install | |
- name: Build and Publish | |
run: | | |
npm run build | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc | |
npm publish |