14
14
name : Create Release
15
15
runs-on : ubuntu-latest
16
16
outputs :
17
- upload_url : ${{ steps.create_release.outputs.upload_url }}
18
17
tag_name : ${{ steps.get_version.outputs.tag_name }}
19
18
steps :
20
19
- name : Checkout code
@@ -46,31 +45,31 @@ jobs:
46
45
47
46
- name : Create Release
48
47
id : create_release
49
- uses : actions/create -release@v1
48
+ uses : softprops/action-gh -release@v1
50
49
env :
51
50
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
51
with :
53
52
tag_name : ${{ steps.get_version.outputs.tag_name }}
54
- release_name : Release ${{ steps.get_version.outputs.tag_name }}
53
+ name : Release ${{ steps.get_version.outputs.tag_name }}
55
54
body : |
56
55
## Changes in ${{ steps.get_version.outputs.tag_name }}
57
-
56
+
58
57
${{ steps.changelog.outputs.changelog }}
59
-
58
+
60
59
## Installation
61
-
60
+
62
61
```bash
63
62
go get github.com/scagogogo/gradle-parser@${{ steps.get_version.outputs.tag_name }}
64
63
```
65
-
64
+
66
65
## Documentation
67
-
66
+
68
67
- [API Documentation](https://scagogogo.github.io/gradle-parser/api/)
69
68
- [User Guide](https://scagogogo.github.io/gradle-parser/guide/)
70
69
- [Examples](https://github.com/scagogogo/gradle-parser/tree/${{ steps.get_version.outputs.tag_name }}/examples)
71
-
70
+
72
71
## Checksums
73
-
72
+
74
73
See the assets below for checksums of the release artifacts.
75
74
draft : false
76
75
prerelease : ${{ contains(steps.get_version.outputs.tag_name, '-') }}
@@ -109,17 +108,17 @@ jobs:
109
108
GOARCH : ${{ matrix.goarch }}
110
109
run : |
111
110
mkdir -p dist
112
-
111
+
113
112
# Build each example
114
113
for example in examples/*/; do
115
114
if [ -f "$example/main.go" ]; then
116
115
example_name=$(basename "$example")
117
116
output_name="gradle-parser-${example_name}-${{ matrix.goos }}-${{ matrix.goarch }}"
118
-
117
+
119
118
if [ "${{ matrix.goos }}" = "windows" ]; then
120
119
output_name="${output_name}.exe"
121
120
fi
122
-
121
+
123
122
echo "Building $example_name for ${{ matrix.goos }}/${{ matrix.goarch }}"
124
123
cd "$example"
125
124
go build -ldflags="-s -w" -o "../dist/$output_name" .
@@ -132,44 +131,45 @@ jobs:
132
131
cd dist
133
132
if [ "${{ matrix.goos }}" = "windows" ]; then
134
133
zip -r "gradle-parser-examples-${{ matrix.goos }}-${{ matrix.goarch }}.zip" .
135
- echo "ASSET_NAME=gradle-parser-examples-${{ matrix.goos }}-${{ matrix.goarch }}.zip" >> $GITHUB_ENV
136
134
else
137
135
tar -czf "gradle-parser-examples-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz" .
138
- echo "ASSET_NAME=gradle-parser-examples-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz" >> $GITHUB_ENV
139
136
fi
140
137
141
- - name : Upload Release Asset
142
- uses : actions/upload-release-asset@v1
143
- env :
144
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
138
+ - name : Upload artifacts
139
+ uses : actions/upload-artifact@v4
145
140
with :
146
- upload_url : ${{ needs.release.outputs.upload_url }}
147
- asset_path : ./dist/${{ env.ASSET_NAME }}
148
- asset_name : ${{ env.ASSET_NAME }}
149
- asset_content_type : application/octet-stream
150
-
151
- # Generate and upload checksums
152
- checksums :
153
- name : Generate Checksums
141
+ name : release-assets-${{ matrix.goos }}-${{ matrix.goarch }}
142
+ path : dist/*
143
+
144
+ # Upload all assets to release
145
+ upload-assets :
146
+ name : Upload Release Assets
154
147
runs-on : ubuntu-latest
155
148
needs : [release, build-assets]
156
149
steps :
157
150
- name : Download all artifacts
158
- uses : actions/download-artifact@v3
151
+ uses : actions/download-artifact@v4
152
+ with :
153
+ path : artifacts
159
154
160
- - name : Generate checksums
155
+ - name : Prepare release assets
161
156
run : |
162
- find . -name "*.tar.gz" -o -name "*.zip" | xargs sha256sum > checksums.txt
157
+ mkdir -p release-assets
158
+ find artifacts -name "*.tar.gz" -o -name "*.zip" | while read file; do
159
+ cp "$file" release-assets/
160
+ done
161
+
162
+ # Generate checksums
163
+ cd release-assets
164
+ sha256sum * > checksums.txt
163
165
164
- - name : Upload checksums
165
- uses : actions/upload-release-asset @v1
166
+ - name : Upload all assets to release
167
+ uses : softprops/action-gh-release @v1
166
168
env :
167
169
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168
170
with :
169
- upload_url : ${{ needs.release.outputs.upload_url }}
170
- asset_path : ./checksums.txt
171
- asset_name : checksums.txt
172
- asset_content_type : text/plain
171
+ tag_name : ${{ needs.release.outputs.tag_name }}
172
+ files : release-assets/*
173
173
174
174
# Update documentation
175
175
update-docs :
@@ -208,7 +208,7 @@ jobs:
208
208
notify :
209
209
name : Notify Release
210
210
runs-on : ubuntu-latest
211
- needs : [release, build-assets, checksums , update-docs]
211
+ needs : [release, build-assets, upload-assets , update-docs]
212
212
if : always()
213
213
steps :
214
214
- name : Release Summary
0 commit comments