|
7 | 7 |
|
8 | 8 | permissions: |
9 | 9 | contents: write |
| 10 | + pull-requests: read |
10 | 11 |
|
11 | 12 | jobs: |
12 | 13 | build-and-release: |
@@ -77,19 +78,41 @@ jobs: |
77 | 78 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
78 | 79 | run: | |
79 | 80 | next="${{ steps.next.outputs.next }}" |
| 81 | + echo "Creating release: $next" |
| 82 | + |
| 83 | + # Create and push tag |
80 | 84 | git tag "$next" |
81 | 85 | git push origin "$next" |
82 | | - gh release create "$next" --generate-notes || true |
| 86 | + |
| 87 | + # Create release with proper error handling |
| 88 | + if gh release create "$next" --generate-notes; then |
| 89 | + echo "Release $next created successfully" |
| 90 | + else |
| 91 | + echo "Failed to create release $next, but continuing..." |
| 92 | + exit 1 |
| 93 | + fi |
83 | 94 |
|
84 | 95 | - name: Attach binaries (Linux/macOS) |
85 | | - if: always() |
| 96 | + if: success() |
86 | 97 | env: |
87 | 98 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
88 | 99 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
89 | 100 | run: | |
| 101 | + next="${{ steps.next.outputs.next }}" |
| 102 | + echo "Uploading binaries for release: $next" |
| 103 | + |
90 | 104 | # Build static binaries for common platforms |
91 | 105 | mkdir -p dist |
92 | 106 | GOOS=linux GOARCH=amd64 go build -o dist/golearn-linux-amd64 ./cmd/golearn |
93 | 107 | GOOS=darwin GOARCH=arm64 go build -o dist/golearn-darwin-arm64 ./cmd/golearn |
94 | | - gh release upload "${{ steps.next.outputs.next }}" dist/* --clobber |
| 108 | + GOOS=darwin GOARCH=amd64 go build -o dist/golearn-darwin-amd64 ./cmd/golearn |
| 109 | + GOOS=windows GOARCH=amd64 go build -o dist/golearn-windows-amd64.exe ./cmd/golearn |
| 110 | + |
| 111 | + # Upload binaries to the release |
| 112 | + if gh release upload "$next" dist/* --clobber; then |
| 113 | + echo "Binaries uploaded successfully" |
| 114 | + else |
| 115 | + echo "Failed to upload binaries" |
| 116 | + exit 1 |
| 117 | + fi |
95 | 118 |
|
0 commit comments