Skip to content

Commit

Permalink
Fix Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rjuer committed Sep 13, 2024
1 parent 929235a commit 4202eb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: "1.22.4"
- name: Get latest Git tag
run:
VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build
run: |
mkdir dist
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} make build
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w X 'github.com/rjuer/cidr/cmd.version=$(VERSION)'" -o dist/
- name: Test
run: |
mkdir tmp
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: "1.22.4"
- name: Get latest Git tag
run:
VERSION=$(git describe --tags --abbrev=0)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build
run: |
mkdir dist
make build
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w X 'github.com/rjuer/cidr/cmd.version=$(VERSION)'" -o dist/
- name: Test
run: |
mkdir tmp
Expand Down

0 comments on commit 4202eb5

Please sign in to comment.