Skip to content

Commit

Permalink
fix: Move from git-tags to git-semver-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Nov 3, 2022
1 parent 973c0dd commit 4a62d2b
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 53 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/ci-deploy-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn add git-semver-tags

- 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);
});
run: node git-tags.js

- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
with:
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/ci-deploy-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,18 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn add git-semver-tags

- 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);
});
run: node git-tags.js

- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
with:
Expand Down
9 changes: 5 additions & 4 deletions git-tags.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var gittags = require("git-tags");
var fs = require("fs");
gittags.get(function (err, tags) {
if (err) throw err;
const gitSemverTags = require("git-semver-tags");
const fs = require("fs");

gitSemverTags(function (err, tags) {
if (err) return;
const obj = {
version: tags[0],
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@types/react-dom": "18.0.3",
"eslint": "8.14.0",
"eslint-config-next": "12.1.6",
"git-tags": "^0.2.4",
"git-semver-tags": "^4.1.1",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "2.6.2",
Expand Down
Loading

0 comments on commit 4a62d2b

Please sign in to comment.