@@ -5,74 +5,43 @@ name: Upload Packages to new release
5
5
release :
6
6
types :
7
7
- published
8
+ workflow_dispatch :
9
+ inputs :
10
+ ref :
11
+ description : ' Git tag to push the image'
12
+ required : true
13
+ type : string
8
14
9
15
jobs :
10
16
build :
11
17
name : Build
12
18
runs-on : ubuntu-latest
13
19
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
-
20
20
steps :
21
21
- uses : actions/checkout@v4
22
22
name : Checkout
23
23
with :
24
24
# Otherwise there's a risk to not get latest tag
25
25
# 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 }}
28
29
- name : Build packages
29
30
id : build
30
31
run : |
31
32
# Checkout action doesn't fetch tags
32
33
git fetch --tags
33
34
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
60
36
env :
61
37
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
71
43
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