@@ -5,74 +5,43 @@ name: Upload Packages to new release
55 release :
66 types :
77 - published
8+ workflow_dispatch :
9+ inputs :
10+ ref :
11+ description : ' Git tag to push the image'
12+ required : true
13+ type : string
814
915jobs :
1016 build :
1117 name : Build
1218 runs-on : ubuntu-latest
1319
14- outputs :
15- deb : ${{ steps.build.outputs.deb }}
16- rpm : ${{ steps.build.outputs.rpm }}
17- sha256sum : ${{ steps.build.outputs.sha256sum }}
18- md5sum : ${{ steps.build.outputs.md5sum }}
19-
2020 steps :
2121 - uses : actions/checkout@v4
2222 name : Checkout
2323 with :
2424 # Otherwise there's a risk to not get latest tag
2525 # We hope, that the current commit at
26- # least 50 commits close to the latest release
27- fetch-depth : 50
26+ # least 100 commits close to the latest release
27+ fetch-depth : 100
28+ ref : ${{ inputs.ref }}
2829 - name : Build packages
2930 id : build
3031 run : |
3132 # Checkout action doesn't fetch tags
3233 git fetch --tags
3334 make -e CGO_ENABLED=0 packages
34- make github_artifact
35- - name : Upload rpm
36- id : upload-rpm
37- uses : actions/upload-release-asset@v1
38- env :
39- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40- ASSET : ${{ steps.build.outputs.rpm }}
41- with :
42- upload_url : ${{ github.event.release.upload_url }}
43- asset_path : artifact/${{ env.ASSET }}
44- asset_name : ${{ env.ASSET }}
45- asset_content_type : application/octet-stream
46- - name : Upload sha256sum
47- id : upload-sha256sum
48- uses : actions/upload-release-asset@v1
49- env :
50- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51- ASSET : ${{ steps.build.outputs.sha256sum }}
52- with :
53- upload_url : ${{ github.event.release.upload_url }}
54- asset_path : artifact/${{ env.ASSET }}
55- asset_name : ${{ env.ASSET }}
56- asset_content_type : application/octet-stream
57- - name : Upload md5sum
58- id : upload-md5sum
59- uses : actions/upload-release-asset@v1
35+ - name : Upload release assets
6036 env :
6137 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62- ASSET : ${{ steps.build.outputs.md5sum }}
63- with :
64- upload_url : ${{ github.event.release.upload_url }}
65- asset_path : artifact/${{ env.ASSET }}
66- asset_name : ${{ env.ASSET }}
67- asset_content_type : application/octet-stream
68- - name : Upload deb
69- id : upload-deb
70- uses : actions/upload-release-asset@v1
38+ run : |
39+ TAG="${{ inputs.ref && inputs.ref || github.event.release.tag_name }}"
40+ gh release upload --repo ${{ github.repository }} "$TAG" \
41+ out/*.deb out/*.rpm out/*sum
42+ - name : Upload packages to packagecloud.com
7143 env :
72- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73- ASSET : ${{ steps.build.outputs.deb }}
74- with :
75- upload_url : ${{ github.event.release.upload_url }}
76- asset_path : artifact/${{ env.ASSET }}
77- asset_name : ${{ env.ASSET }}
78- asset_content_type : application/octet-stream
44+ PACKAGECLOUD_TOKEN : ${{ secrets.PACKAGECLOUD_TOKEN }}
45+ run : |
46+ go install github.com/mlafeldt/pkgcloud/cmd/pkgcloud-push
47+ make packagecloud-stable
0 commit comments