mirror of
https://github.com/unraid/api.git
synced 2026-05-02 05:01:34 -05:00
fix: use GITHUB env for git short hash
This commit is contained in:
@@ -181,7 +181,11 @@ jobs:
|
||||
|
||||
- name: Add commit hash to version
|
||||
if: startsWith(github.ref, 'refs/tags/v') == false
|
||||
run: npm run mark-version-commit
|
||||
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 > package.json && \
|
||||
echo '✔ Version field updated'
|
||||
|
||||
- name: Build binary
|
||||
run: npm run build-binary
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"build-binary-step-1": "nexe ./dist/cli.js --make=\"-j$(nproc 2> /dev/null || echo 1)\" -r './dist/**/*' -r './node_modules' && mv ./cli ./unraid-api && echo '✔ Binary built: ./unraid-api'",
|
||||
"build-binary-step-2": "rm -rf ./node_modules && rm -rf ./dist && echo '✔ Source files deleted'",
|
||||
"build-binary": "npm run build-binary-step-1 && npm run build-binary-step-2",
|
||||
"mark-version-commit": "VERSION=$(jq -r .version package.json) && SHORT_HASH=$(git rev-parse --short HEAD) && jq --arg version \"$VERSION-$SHORT_HASH\" '.version = $version' package.json > package.json && echo '✔ Version field updated'",
|
||||
"copy-schemas": "cpx app/**/*.graphql dist/types",
|
||||
"clean": "modclean --no-progress --run --path .",
|
||||
"commit": "npx git-cz",
|
||||
|
||||
Reference in New Issue
Block a user