Skip to content

modify trivial thing #6

modify trivial thing

modify trivial thing #6

Workflow file for this run

name: Deployment
on:
push:
branches:
- develop
- fix/deployment-workflow
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.filter.outputs.changed }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Check for changes in .ts and .tsx files
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
changed:
- 'src/**/*.ts'
- 'src/**/*.tsx'
deploy:
runs-on: ubuntu-latest
needs: check-changes
if: ${{ needs.check-changes.outputs.changed == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Bump version
run: yarn version patch
- name: Publish package
run: |
echo "npmAuthToken: \${NPM_TOKEN}" >> .yarnrc.yml
yarn npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Set git username with email
run: |
git config user.name "pumpkiinbell"
git config user.email "[email protected]"
- name: Tag version
run: |
VERSION=$(jq -r '.version' package.json)
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
git tag -a "v$VERSION" -m "$COMMIT_MESSAGE"
- name: Commit version bump
run: |
VERSION=$(jq -r '.version' package.json)
git add package.json
git commit -m "bump version to $VERSION"
- name: Push changes and tags
run: |
git push -u origin HEAD --follow-tags --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}