From 8b2c54c30fb62223f03869685ded934c46d5d076 Mon Sep 17 00:00:00 2001 From: Takuo Kitame Date: Thu, 21 Dec 2023 01:19:45 +0900 Subject: [PATCH] fix(earthly): fix failed to retrieve artifact add CGO_ENABLED=0 --- .github/workflows/publish.yml | 2 +- Earthfile | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68dc59a..8d734fd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: diff --git a/Earthfile b/Earthfile index f9e4a65..1c3dd83 100644 --- a/Earthfile +++ b/Earthfile @@ -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 \ No newline at end of file