From 5a46501334c3565fafb28b07e33dea119553b5fa Mon Sep 17 00:00:00 2001 From: Alexis Date: Wed, 29 Sep 2021 15:31:15 +0930 Subject: [PATCH] chore: move commit hash injection to before source pack --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9aef86efe..2236c097f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -133,6 +133,14 @@ jobs: - name: Clean node_modules run: npm run clean && curl -sf https://gobinaries.com/tj/node-prune | sh && node-prune + - name: Add commit hash to version + if: startsWith(github.ref, 'refs/tags/v') == false + run: | + VERSION=$(jq -r .version package.json) && \ + SHORT_HASH=$(echo $GITHUB_SHA | cut -c 1-7) && \ + jq --arg version $VERSION-$SHORT_HASH '.version = $version' package.json > out.json && mv out.json package.json && \ + echo '✔ Version field updated' + - name: Pack source run: npm pack @@ -179,14 +187,6 @@ jobs: - name: Install nexe run: npm i -g nexe - - name: Add commit hash to version - if: startsWith(github.ref, 'refs/tags/v') == false - run: | - VERSION=$(jq -r .version package.json) && \ - SHORT_HASH=$(echo $GITHUB_SHA | cut -c 1-7) && \ - jq --arg version $VERSION-$SHORT_HASH '.version = $version' package.json > out.json && mv out.json package.json && \ - echo '✔ Version field updated' - - name: Build binary run: npm run build-binary