-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,22 @@ jobs: | |
- name: print new latest kexa version | ||
run: echo ${{ steps.get_latest_release.outputs.release }} | ||
|
||
- name: Run Javascript to update local files | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
run: | | ||
npm install | ||
node update-app-version.js "${{ steps.get_latest_release.outputs.release }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
|
||
- name: Commit and push changes to dev | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
git add charts/kexa-chart/Chart.yaml | ||
git commit -m "chore(release): update Chart.yaml appversion" | ||
git push origin dev | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// YAML TO JSON | ||
// CHANGE APP VERSION | ||
// THEN JSON TO YAML AND WRITE TO FILE | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const yaml = require('js-yaml'); | ||
|
||
const newVersion = process.argv[2]; | ||
|
||
if (!newVersion) { | ||
console.error('Error: No version specified.'); | ||
process.exit(1); | ||
} | ||
|
||
const chartFilePath = 'charts/kexa-chart/Chart.yaml'; | ||
|
||
if (!fs.existsSync(chartFilePath)) { | ||
console.error(`Error: ${chartFilePath} not found.`); | ||
process.exit(1); | ||
} | ||
|
||
let fileContent = fs.readFileSync(chartFilePath, 'utf8'); | ||
let chartData; | ||
|
||
try { | ||
chartData = yaml.load(fileContent); | ||
} catch (e) { | ||
console.error('Error parsing YAML:', e); | ||
process.exit(1); | ||
} | ||
|
||
if (chartData.version) { | ||
chartData.appVersion = newVersion; | ||
console.log(`Updating version to ${newVersion}`); | ||
} else { | ||
console.error('Version field not found in Chart.yaml.'); | ||
process.exit(1); | ||
} | ||
|
||
const updatedYaml = yaml.dump(chartData); | ||
fs.writeFileSync(chartFilePath, updatedYaml, 'utf8'); | ||
console.log(`Updated ${chartFilePath} to version ${newVersion}`); |
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