Skip to content

Commit

Permalink
fix: integrate git tags (#24)
Browse files Browse the repository at this point in the history
* feat: add get version script to get tag
  • Loading branch information
aspnxdd authored Jul 26, 2022
1 parent d7a5e1d commit ac3433c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/deploy_preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/deploy_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ac3433c

Please sign in to comment.