mirror of
https://github.com/unraid/api.git
synced 2026-02-18 05:58:28 -06:00
chore: move commit hash injection to before source pack
This commit is contained in:
16
.github/workflows/main.yml
vendored
16
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user