-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add get version script to get tag
- Loading branch information
Showing
2 changed files
with
21 additions
and
13 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 |
---|---|---|
|
@@ -9,19 +9,7 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Extract version from tag | ||
uses: damienaicheh/[email protected] | ||
|
||
- name: Output the variables | ||
run: | | ||
echo The major was $MAJOR | ||
echo The minor was $MINOR | ||
echo The patch was $PATCH | ||
echo The pre-release was $PRE_RELEASE | ||
echo The number of commits was $NUMBER_OF_COMMITS | ||
echo The number of commits since tag was $NUMBER_OF_COMMITS_SINCE_TAG | ||
- name: save version file | ||
- name: Get tag version | ||
uses: satackey/[email protected] | ||
id: getdata | ||
with: | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,26 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get tag version | ||
uses: satackey/[email protected] | ||
id: getdata | ||
with: | ||
# Edit the following line to install packages required to run your script. | ||
required-packages: git-tags | ||
script: | | ||
var gittags = require("git-tags"); | ||
var fs = require("fs"); | ||
gittags.get(function (err, tags) { | ||
if (err) throw err; | ||
const obj = { | ||
version: tags[0], | ||
}; | ||
fs.writeFileSync("version.json", JSON.stringify(obj), "utf8"); | ||
console.log(tags); | ||
}); | ||
- name: Deploy to Vercel Action | ||
uses: BetaHuhn/deploy-to-vercel-action@v1 | ||
with: | ||
|