Skip to content

Commit a31895c

Browse files
committed
Make version number be combination of package.json and github run number
1 parent d85afa1 commit a31895c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/release.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ jobs:
2020

2121
- name: Run Tests
2222
run: bun test
23+
24+
- name: Set Version Number
25+
id: version
26+
run: |
27+
BASE_VERSION=$(node -p "require('./package.json').version")
28+
FULL_VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}"
29+
echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV
30+
# Update package.json with new version
31+
node -e "const pkg=require('./package.json'); pkg.version='$FULL_VERSION'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2))"
2332
2433
- name: Build Executable
2534
run: |
26-
bun build index.ts --compile --target=bun-windows-x64 --outfile bts
35+
bun build src/index.ts --compile --target=bun-windows-x64 --outfile bts
2736
# Windows builds automatically add .exe extension
2837
chmod +x bts.exe
2938
@@ -33,8 +42,8 @@ jobs:
3342
env:
3443
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3544
with:
36-
tag_name: v${{ github.run_number }}
37-
release_name: Release v${{ github.run_number }}
45+
tag_name: v${{ env.FULL_VERSION }}
46+
release_name: Release v${{ env.FULL_VERSION }}
3847
draft: false
3948
prerelease: false
4049

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bloom-translate-spreadsheet",
3-
"version": "0.0.1",
3+
"version": "0.0",
44
"module": "index.ts",
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)