Skip to content

Commit 3f77edc

Browse files
authored
Merge pull request #1689 from cpunion/ci-check-upload-result
CI: check upload result, test upload to winget/fury
2 parents 9979a40 + 86b6c95 commit 3f77edc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/release-build.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,20 @@ jobs:
4949
args: release --clean -p 4
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
5253
WINGET_PKGS_PRIVATE_KEY: ${{ secrets.WINGET_PKGS_PRIVATE_KEY }}
5354

5455
- name: Upload deb/rpm to Fury.io
5556
run: |
5657
for file in dist/*.{deb,rpm}
5758
do
5859
echo "Uploading $file to Fury.io"
59-
curl -sS -F package=@$file https://[email protected]/goplus/
60+
CODE=`curl --write-out '%{http_code}' --output /dev/null -sS -F package=@$file https://[email protected]/$GITHUB_REPOSITORY_OWNER/`
61+
if [ "$CODE" != "200" ]; then
62+
echo "Upload failed with code $CODE"
63+
exit 1
64+
fi
6065
done
6166
env:
6267
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
68+
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}

.goreleaser.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ winget:
9696
license: Apache-2.0
9797
skip_upload: false
9898
release_notes: "{{.Changelog}}"
99-
release_notes_url: "https://github.com/goplus/gop/releases/tag/v{{.Version}}"
99+
release_notes_url: "https://github.com/{{ .Env.GITHUB_REPOSITORY_OWNER }}/gop/releases/tag/v{{.Version}}"
100100
dependencies:
101101
- package_identifier: GoLang.Go
102102
minimum_version: 1.18.0
@@ -105,7 +105,7 @@ winget:
105105
name: winget-pkgs
106106
branch: "{{.ProjectName}}-v{{.Version}}"
107107
git:
108-
url: "[email protected]:goplus/winget-pkgs.git"
108+
url: "[email protected]:{{ .Env.GITHUB_REPOSITORY_OWNER }}/winget-pkgs.git"
109109
private_key: "{{ .Env.WINGET_PKGS_PRIVATE_KEY }}"
110110
pull_request:
111111
enabled: true

0 commit comments

Comments
 (0)