Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding script to pipeline to automatically bump version #2

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Auto Bump Version

on:
push:
branches:
- main # Trigger on push to main branch

jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.LICHTBLICK_GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- run: corepack enable

- name: Cache yarn dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --mode skip-build
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false

- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'

- name: Bump version in root package.json
run: yarn version --new-version patch --no-git-tag-version

- name: Commit version bumps
id: commit_version_bumps
run: |
git add package.json yarn.lock
git commit -m "chore: bump versions in root package.json [skip actions]"
echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Push changes
run: |
git push origin main
Loading