Skip to content

Commit

Permalink
fix: get git-revision.txt when out of tree
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 23, 2020
1 parent 19d0e13 commit 3275022
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Save Git revision
run: git log -1 --format='%H' > packages/cosmic-swingset/lib/git-revision.txt
- name: Build Go dependencies image
uses: elgohr/Publish-Docker-Github-Action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MOD_READONLY = # -mod=readonly

NAME := $(shell sed -ne 's/.*"name": "\([^"]*\)".*/\1/p' package.json)
VERSION := $(shell sed -ne 's/.*"version": "\([^"]*\)".*/\1/p' package.json)
COMMIT := $(shell git log -1 --format='%H' || cat lib/git-revision.txt)
COMMIT := $(shell git log -1 --format='%H' 2>/dev/null || cat lib/git-revision.txt)

ldflags = \
-X github.com/cosmos/cosmos-sdk/version.Name=$(NAME) \
Expand Down

0 comments on commit 3275022

Please sign in to comment.