diff --git a/.github/workflows/ci-deploy-preview.yaml b/.github/workflows/ci-deploy-preview.yaml index 513c62f..85db318 100644 --- a/.github/workflows/ci-deploy-preview.yaml +++ b/.github/workflows/ci-deploy-preview.yaml @@ -19,7 +19,7 @@ jobs: - name: Get tag version id: getdata - run: node git-tags.js + run: bash git-tags.sh - name: Deploy to Vercel Action uses: BetaHuhn/deploy-to-vercel-action@v1 diff --git a/.github/workflows/ci-deploy-production.yaml b/.github/workflows/ci-deploy-production.yaml index c4f30d6..7cc27f3 100644 --- a/.github/workflows/ci-deploy-production.yaml +++ b/.github/workflows/ci-deploy-production.yaml @@ -22,7 +22,7 @@ jobs: - name: Get tag version id: getdata - run: node git-tags.js + run: bash git-tags.sh - name: Deploy to Vercel Action uses: BetaHuhn/deploy-to-vercel-action@v1 diff --git a/git-tags.js b/git-tags.js deleted file mode 100644 index 39c2ee1..0000000 --- a/git-tags.js +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-disable no-console */ -const gitSemverTags = require('git-semver-tags'); -const fs = require('fs'); - -gitSemverTags((err, tags) => { - if (err) return; - const obj = { - version: tags[0], - }; - fs.writeFileSync('version.json', JSON.stringify(obj), 'utf8'); - console.log(tags); -}); diff --git a/git-tags.sh b/git-tags.sh new file mode 100644 index 0000000..44d6f29 --- /dev/null +++ b/git-tags.sh @@ -0,0 +1,3 @@ +#!/bin/bash +tag=$(git describe --abbrev=0) +echo "{\"version\":\"${tag}\"}" > version.json diff --git a/package.json b/package.json index 4842acd..959a5df 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,11 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", + "dev": "bash git-tags.sh && next dev", + "build": "bash git-tags.sh && next build", "start": "next start", "lint": "npx eslint . --ext .ts,.tsx", - "tag": "node git-tags.js", + "tag": "bash git-tags.sh", "format": "prettier --write \"./**/*.{tsx,ts,css}\"", "prepare": "husky install" }, @@ -54,7 +54,6 @@ "eslint": "8.32.0", "git-semver-tags": "^4.1.1", "eslint-config-next": "13.1.5", - "git-tags": "^0.2.4", "husky": ">=8.0.3", "lint-staged": ">=13.1.0", "octicons-react": "link:@types/@primer/octicons-react", diff --git a/version.json b/version.json index f64ae35..f1d9aa2 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version":"v0.1.0"} \ No newline at end of file +{"version":"v1.0.0"}