From a5000c0621149f54e79e7ac3df2a7b8e15975f11 Mon Sep 17 00:00:00 2001 From: hiCasper Date: Wed, 20 May 2020 11:48:00 +0800 Subject: [PATCH] Modify: update actions (#398) --- .github/workflows/build.yml | 26 ++++++++++++++++++++++---- build.sh | 7 ++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adb6428..7a42eae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,8 +63,26 @@ jobs: chmod +x ./build.sh ./build.sh -r b - - name: Upload binary files - uses: actions/upload-artifact@v1 + - name: Upload binary files (windows_amd64) + uses: actions/upload-artifact@v2 with: - name: release - path: release/ + name: cloudreve_windows_amd64 + path: release/cloudreve*windows_amd64.* + + - name: Upload binary files (linux_amd64) + uses: actions/upload-artifact@v2 + with: + name: cloudreve_linux_amd64 + path: release/cloudreve*linux_amd64.* + + - name: Upload binary files (linux_arm) + uses: actions/upload-artifact@v2 + with: + name: cloudreve_linux_arm + path: release/cloudreve*linux_arm.* + + - name: Upload binary files (linux_arm64) + uses: actions/upload-artifact@v2 + with: + name: cloudreve_linux_arm64 + path: release/cloudreve*linux_arm64.* diff --git a/build.sh b/build.sh index 5ebd3da..ea7e101 100755 --- a/build.sh +++ b/build.sh @@ -55,7 +55,12 @@ _build() { export CC=$gcc export CGO_ENABLED=1 - out="release/cloudreve_${VERSION}_${os}_${arch}" + if [ -n "$VERSION" ]; then + out="release/cloudreve_${VERSION}_${os}_${arch}" + else + out="release/cloudreve_${COMMIT_SHA}_${os}_${arch}" + fi + go build -a -o "${out}" -ldflags " -X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=$VERSION' -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=$COMMIT_SHA'" if [ "$os" = "windows" ]; then