Skip to content

Commit

Permalink
chore: automatic version update (package.json)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianmusial committed Mar 15, 2024
1 parent 5a08124 commit 08373b4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Lint Commit Messages

on: [pull_request]

permissions:
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/demo-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
name: Demo deploy

on:
push:
branches:
- master
- main
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v2
- name: Update package.json version
uses: actions/github-script@v5
with:
script: |
const fs = require('fs');
const path = 'package.json';
const packageJson = JSON.parse(fs.readFileSync(path));
packageJson.version = '${{ github.event.release.tag_name }}';
fs.writeFileSync(path, JSON.stringify(packageJson, null, 2) + '\n');
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add package.json
git commit -m "Update package version to ${{ github.event.release.tag_name }}"
git push
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Publish package to GitHub Packages

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 08373b4

Please sign in to comment.