Skip to content

Commit 0d76b81

Browse files
committed
fix: update version extraction method in release step to use make command
1 parent 7b1c9c7 commit 0d76b81

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ jobs:
212212
runs-on: ubuntu-latest
213213
name: release
214214
needs: build
215-
#if: github.ref == 'refs/heads/main'
216215

217216
env:
218217
GH_TOKEN: ${{ github.token }}
@@ -234,8 +233,7 @@ jobs:
234233
- name: release tag version from cloudsync.h
235234
id: tag
236235
run: |
237-
FILE="src/cloudsync.h"
238-
VERSION=$(grep -oP '#define CLOUDSYNC_VERSION\s+"\K[^"]+' "$FILE")
236+
VERSION=$(make version)
239237
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
240238
LATEST=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name')
241239
if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
@@ -254,7 +252,7 @@ jobs:
254252
registry-url: 'https://registry.npmjs.org'
255253

256254
- name: wasm publish to npmjs
257-
#if: steps.tag.outputs.version != ''
255+
if: steps.tag.outputs.version != ''
258256
#use this version when the repo will become public run: npm publish --provenance --access public ./artifacts/cloudsync-wasm/sqlite-wasm/sqliteai-cloudsync-wasm-*-cloudsync-*.tgz
259257
run: npm publish --access public ./artifacts/cloudsync-wasm/sqlite-wasm/sqliteai-cloudsync-wasm-*-cloudsync-*.tgz
260258
env:
@@ -274,8 +272,7 @@ jobs:
274272
done
275273
276274
- uses: softprops/[email protected]
277-
if: false
278-
#if: steps.tag.outputs.version != ''
275+
if: steps.tag.outputs.version != ''
279276
with:
280277
generate_release_notes: true
281278
tag_name: ${{ steps.tag.outputs.version }}

0 commit comments

Comments
 (0)