Update README.md #24
Workflow file for this run
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: Bump and publish md-css to npm | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'packages/css/**' | |
types: | |
- closed | |
jobs: | |
bump: | |
name: Bump package version | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Git config | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- name: Apply version bump (major) | |
if: contains(github.event.pull_request.labels.*.name, 'major') | |
run: npm version major | |
working-directory: ./packages/css | |
- name: Apply version bump (minor) | |
if: contains(github.event.pull_request.labels.*.name, 'minor') | |
run: npm version minor | |
working-directory: ./packages/css | |
- name: Apply version bump (patch) | |
if: contains(github.event.pull_request.labels.*.name, 'patch') | |
run: npm version patch | |
working-directory: ./packages/css | |
- id: set-version | |
name: Output version change | |
run: echo "PKG_VERSION=$(npm pkg get version)" >> $GITHUB_ENV | |
working-directory: ./packages/css | |
- name: Git add | |
run: git add . | |
- name: Git commit | |
run: git commit -m "Bump md-css version to ${{ env.PKG_VERSION }}" | |
- name: Git push version bump | |
run: git push origin main --force | |
build: | |
name: Build & Publish | |
needs: bump | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./packages/css | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm install | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |