Skip to content

Commit 47f1d03

Browse files
修复 release
1 parent 2666841 commit 47f1d03

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

.github/workflows/go-release.yml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ jobs:
1616
uses: actions/setup-go@v5
1717
with:
1818
go-version: '1.25'
19-
- name: Generate changelog
20-
id: changelog
21-
uses: metcalfc/[email protected]
22-
with:
23-
myToken: ${{ secrets.GITHUB_TOKEN }}
2419
- name: Build releases
2520
run: |
2621
APP_NAME="gitea-pages"
27-
# 创建输出目录
2822
mkdir -p dist
29-
3023
GOOS=linux GOARCH=amd64 go build -o "dist/${APP_NAME}-linux-amd64" ./
3124
GOOS=linux GOARCH=386 go build -o "dist/${APP_NAME}-linux-i386" ./
3225
GOOS=linux GOARCH=arm64 go build -o "dist/${APP_NAME}-linux-arm64" ./
@@ -36,36 +29,21 @@ jobs:
3629
GOOS=darwin GOARCH=arm64 go build -o "dist/${APP_NAME}-darwin-arm64" ./
3730
3831
GOOS=windows GOARCH=amd64 go build -o "dist/${APP_NAME}-windows-amd64.exe" ./
39-
32+
cp LICENSE dist/license.txt
4033
cd dist
41-
for file in *; do
42-
zip "${file}.zip" "$file"
34+
for file in "${APP_NAME}-"*; do
35+
zip "${file}.zip" "$file" "license.txt"
4336
done
4437
ls *.zip > assets.txt
4538
cd ..
4639
4740
- name: Create GitHub Release
4841
id: create_release
49-
uses: actions/create-release@v1
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
uses: softprops/action-gh-release@v2
5243
with:
5344
tag_name: ${{ github.ref }}
54-
release_name: Release ${{ github.ref_name }}
55-
body: ${{ steps.changelog.outputs.changelog }}
45+
name: Release ${{ github.ref_name }}
5646
draft: false
5747
prerelease: false
58-
59-
- name: Upload all release assets
60-
run: |
61-
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
62-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
63-
sudo apt update
64-
sudo apt install gh -y
65-
66-
while IFS= read -r asset; do
67-
echo "Uploading $asset"
68-
gh release upload ${{ github.ref_name }} ./dist/$asset --clobber
69-
done < ./dist/assets.txt
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
files: |
49+
dist/*.zip

0 commit comments

Comments
 (0)