Skip to content

Commit

Permalink
Merge pull request #1689 from cpunion/ci-check-upload-result
Browse files Browse the repository at this point in the history
CI: check upload result, test upload to winget/fury
  • Loading branch information
xushiwei authored Jan 29, 2024
2 parents 9979a40 + 86b6c95 commit 3f77edc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ jobs:
args: release --clean -p 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
WINGET_PKGS_PRIVATE_KEY: ${{ secrets.WINGET_PKGS_PRIVATE_KEY }}

- name: Upload deb/rpm to Fury.io
run: |
for file in dist/*.{deb,rpm}
do
echo "Uploading $file to Fury.io"
curl -sS -F package=@$file https://$FURY_TOKEN@push.fury.io/goplus/
CODE=`curl --write-out '%{http_code}' --output /dev/null -sS -F package=@$file https://$FURY_TOKEN@push.fury.io/$GITHUB_REPOSITORY_OWNER/`
if [ "$CODE" != "200" ]; then
echo "Upload failed with code $CODE"
exit 1
fi
done
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ winget:
license: Apache-2.0
skip_upload: false
release_notes: "{{.Changelog}}"
release_notes_url: "https://github.com/goplus/gop/releases/tag/v{{.Version}}"
release_notes_url: "https://github.com/{{ .Env.GITHUB_REPOSITORY_OWNER }}/gop/releases/tag/v{{.Version}}"
dependencies:
- package_identifier: GoLang.Go
minimum_version: 1.18.0
Expand All @@ -105,7 +105,7 @@ winget:
name: winget-pkgs
branch: "{{.ProjectName}}-v{{.Version}}"
git:
url: "git@github.com:goplus/winget-pkgs.git"
url: "git@github.com:{{ .Env.GITHUB_REPOSITORY_OWNER }}/winget-pkgs.git"
private_key: "{{ .Env.WINGET_PKGS_PRIVATE_KEY }}"
pull_request:
enabled: true
Expand Down

0 comments on commit 3f77edc

Please sign in to comment.