Skip to content

Commit

Permalink
fix: update package.json during docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaclen committed Jul 22, 2024
1 parent ebda4d2 commit 57d37d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- name: Update package.json
run: node .github/workflows/publish/update-package-json.cjs ${{ steps.semantic.outputs.new_release_version }}

docker:
needs: release
if: ${{ needs.release.outputs.new_release_published == 'true' }}
Expand All @@ -42,6 +39,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Update app version in package.json
run: node .github/workflows/publish/update-package-json.cjs ${{ needs.release.outputs.new_release_version }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish/update-package-json.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ fs.readFile('package.json', (err, data) => {
json.version = version;

// Write updated package.json
console.log("##### Updating version in `package.json`");
fs.writeFile('package.json', JSON.stringify(json, null, 2), (err) => {
if (err) throw err;
console.log('Package.json file has been updated');
console.log('##### `package.json` file has been updated. New version: ' + version);
});
});

0 comments on commit 57d37d5

Please sign in to comment.