chore: move commit hash injection to before source pack

This commit is contained in:
Alexis
2021-09-29 15:31:15 +09:30
parent 76389ea8af
commit 5a46501334

View File

@@ -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