-
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
4 changed files
with
65 additions
and
11 deletions.
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 |
---|---|---|
|
@@ -21,17 +21,16 @@ jobs: | |
- name: Get version from package.json before the release step | ||
id: pre_release_version | ||
run: echo "::set-output name=version::$(npm run get-version --silent)" | ||
- name: Release to GitHub | ||
- name: Update package.json and release to GitHub | ||
id: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GIT_AUTHOR_NAME: ops-bot | ||
GITAUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: ops-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
run: | | ||
npm run release | ||
npm run web-ext build | ||
run: npm run release | ||
- name: Get version from package.json after release step | ||
id: post_release_version | ||
run: echo "::set-output name=version::$(npm run get-version --silent)" | ||
|
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,25 @@ | ||
import fs from 'fs'; | ||
|
||
const MANITFEST_FILE = 'src/manifest.json'; | ||
const newVersion = process.argv[2]; | ||
|
||
function exitWithError(error) { | ||
console.log(error); | ||
process.exit(2); | ||
} | ||
|
||
fs.readFile(MANITFEST_FILE, 'utf8', (err, fileContent) => { | ||
if (err) { | ||
exitWithError(err); | ||
} | ||
const newFileContent = fileContent.replace( | ||
/"version": "\d+.\d+.\d+"/g, | ||
`"version": "${newVersion}"` | ||
); | ||
|
||
fs.writeFile(MANITFEST_FILE, newFileContent, 'utf8', (err) => { | ||
if (err) { | ||
exitWithError(err); | ||
} | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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