From d4d5e5ddf4f8967dfc777aca9f1de1eb2b7f73dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Mon, 21 Oct 2024 06:10:36 +0900 Subject: [PATCH] ci: upload zip for windows build --- .drone.jsonnet | 4 +++- .drone.yml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index facefb8..30693ba 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -44,7 +44,9 @@ local StepGoBuild(GOOS, GOARCH) = { }; local StepUploadArtifact(GOOS, GOARCH) = { - local filename = 'um-%s-%s.tar.gz' % [GOOS, GOARCH], + local windows = GOOS == 'windows', + local archiveExt = if windows then 'zip' else 'tar.gz', + local filename = 'um-%s-%s.%s' % [GOOS, GOARCH, archiveExt], local filepath = 'dist/%s' % filename, local pkgname = '${DRONE_REPO_NAME}-build', diff --git a/.drone.yml b/.drone.yml index 873d51e..3ed8117 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,9 +62,9 @@ steps: image: golang:1.22 name: go build windows/amd64 - commands: - - curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64.tar.gz" - "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-windows-amd64.tar.gz" - - sha256sum dist/um-windows-amd64.tar.gz + - curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64.zip" + "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-windows-amd64.zip" + - sha256sum dist/um-windows-amd64.zip - echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER} environment: DRONE_GITEA_SERVER: https://git.unlock-music.dev