Skip to content

Commit

Permalink
Use commit hash in version
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Sharma <[email protected]>
  • Loading branch information
shubham1172 committed May 26, 2023
1 parent 75de260 commit 861fd8f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ jobs:
- name: Configure version
run: |
# Version should be in the format of <version>-dev.<timestamp>
# e.g. 1.0.0-dev.20220101.000000
# Version should be in the format of <version>-<timestamp>-<commit-hash>
# e.g. 1.0.0-20220101000000-abcdef
VERSION=$(npm version | grep '@dapr/dapr' | awk -F':' '{print $2}' | tr -d "[:space:],'")
TIMESTAMP=$(date -u +"%Y%m%d.%H%M%S")
sed -i s#"\"version\": \"$VERSION\""#"\"version\": \"$VERSION-dev.$TIMESTAMP\""# package.json
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
COMMIT_HASH=$(git rev-parse --short HEAD)
sed -i s#"\"version\": \"$VERSION\""#"\"version\": \"$VERSION-$TIMESTAMP-$COMMIT_HASH\""# package.json
- name: Install dependencies
run: npm install
Expand Down

0 comments on commit 861fd8f

Please sign in to comment.