Skip to content

Commit

Permalink
fix(earthly): fix failed to retrieve artifact
Browse files Browse the repository at this point in the history
add CGO_ENABLED=0
  • Loading branch information
takuo committed Dec 20, 2023
1 parent 5e62abc commit 8b2c54c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: +build ${{ matrix.target_os }}/${{ matrix.target_arch }}
run: |
export EARTHLY_REMOTE_CACHE="${{ env.REMOTE_CACHE }}:$(basename ${{ github.repository }})"
earthly -a +build/release --TARGET_OS=${{ matrix.target_os }} --TARGET_ARCH=${{ matrix.target_arch }} ./release/
earthly -a +build/release --TARGET_OS=${{ matrix.target_os }} --TARGET_ARCH=${{ matrix.target_arch }} ./
- name: Upload assets
uses: softprops/action-gh-release@v1
with:
Expand Down
7 changes: 3 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ build:
COPY go.mod go.sum .
RUN go mod download
COPY . .
RUN mkdir dist
RUN GOOS=$TARGET_OS GOARCH=$TARGET_ARCH go build ./
RUN mkdir -p release
RUN CGO_ENABLED=0 GOOS=$TARGET_OS GOARCH=$TARGET_ARCH go build ./
RUN rm -rf release && mkdir -p release
IF [ "$TARGET_OS" = "windows" ]
RUN 7zr a release/chissoku-$(go run . -v)-windows-$TARGET_ARCH.7z chissoku.exe
ELSE
RUN tar -czf release/chissoku-$(go run . -v)-$TARGET_OS-$TARGET_ARCH.tar.gz chissoku
END
SAVE ARTIFACT ./release/* AS LOCAL ./release/
SAVE ARTIFACT release/* release/

release:
# NOT IMPLEMENTED YET

0 comments on commit 8b2c54c

Please sign in to comment.