1
- name : " Release"
1
+ name : Release
2
2
3
3
on :
4
4
push :
@@ -21,124 +21,126 @@ jobs:
21
21
runs-on : ubuntu-latest
22
22
permissions :
23
23
contents : read
24
-
25
24
steps :
26
- - name : Checkout code
25
+ - name : Checkout Code
27
26
uses : actions/checkout@v4
28
27
with :
29
28
fetch-depth : 0
30
-
31
- - name : Set up Go
29
+ - name : Set Up Go
32
30
uses : actions/setup-go@v5
33
31
with :
34
32
go-version : ' 1.21'
35
33
cache : true
36
-
37
- - name : Build release binaries
34
+ cache-dependency-path : go.sum
35
+ - name : Build Release Binaries
38
36
env :
39
37
GOPROXY : https://proxy.golang.org
40
38
CGO_ENABLED : 0
41
39
run : |
42
40
make release
43
-
44
- - name : Upload build artifacts
41
+ - name : Upload Build Artifacts
45
42
uses : actions/upload-artifact@v4
46
43
with :
47
- name : ' pumba-binaries'
44
+ name : pumba-binaries
48
45
path : .bin/**
49
46
retention-days : 7
47
+ compression-level : 6
50
48
51
49
create-release :
52
50
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
53
51
name : Create GitHub Release
54
52
needs : [ build ]
55
53
runs-on : ubuntu-latest
56
54
permissions :
57
- contents : write # Required for creating releases
58
-
55
+ contents : write
59
56
steps :
60
- - name : Checkout code
57
+ - name : Checkout Code
61
58
uses : actions/checkout@v4
62
-
63
- - name : Get tag name
59
+ with :
60
+ fetch-depth : 0
61
+ - name : Get Tag Name
64
62
id : get_tag
65
63
run : echo "git_tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
66
-
67
- - name : Download artifacts
64
+ - name : Download Artifacts
68
65
uses : actions/download-artifact@v4
69
66
with :
70
- name : ' pumba-binaries'
67
+ name : pumba-binaries
71
68
path : ${{ github.workspace }}/.bin/
72
-
69
+ job-id : build
73
70
- name : Create GitHub Release
74
- uses : softprops/action-gh-release@v2
71
+ id : create_release
72
+ uses : actions/create-release@v1
73
+ env :
74
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
75
with :
76
- name : ${{ steps.get_tag.outputs.git_tag }}
77
76
tag_name : ${{ steps.get_tag.outputs.git_tag }}
77
+ release_name : ${{ steps.get_tag.outputs.git_tag }}
78
78
prerelease : true
79
79
generate_release_notes : true
80
- files : |
81
- ${{ github.workspace }}/.bin/**
80
+ - name : Upload Release Assets
81
+ uses : actions/upload-release-asset@v1
82
+ env :
83
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+ with :
85
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
86
+ asset_path : ${{ github.workspace }}/.bin/**
87
+ asset_name : pumba-binaries-${{ steps.get_tag.outputs.git_tag }}.tar.gz
88
+ asset_content_type : application/gzip
82
89
83
90
push-docker :
84
91
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
85
92
name : Push Docker Image
86
93
runs-on : ubuntu-latest
87
94
permissions :
88
95
contents : read
89
- packages : write # Required if pushing to GHCR
90
-
96
+ packages : write
91
97
steps :
92
- - name : Checkout code
98
+ - name : Checkout Code
93
99
uses : actions/checkout@v4
94
-
95
- - name : Get tag name
100
+ with :
101
+ fetch-depth : 0
102
+ - name : Get Tag Name
96
103
id : get_tag
97
104
run : echo "git_tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
98
-
99
- - name : Get short SHA
100
- id : short-sha
105
+ - name : Get Short SHA
106
+ id : short_sha
101
107
run : echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
102
-
103
- - name : Set up Docker Buildx
108
+ - name : Set Up Docker Buildx
104
109
uses : docker/setup-buildx-action@v3
105
110
with :
111
+ driver : docker-container
106
112
platforms : linux/amd64,linux/arm64
107
-
108
- - name : Set up QEMU
113
+ - name : Set Up QEMU
109
114
uses : docker/setup-qemu-action@v3
110
-
111
- - name : Login to Docker registry
115
+ with :
116
+ platforms : linux/amd64,linux/arm64
117
+ - name : Login to Docker Registry
112
118
uses : docker/login-action@v3
113
119
with :
114
120
username : ${{ secrets.DOCKER_ACCOUNT }}
115
121
password : ${{ secrets.DOCKER_TOKEN }}
116
-
117
- - name : Build metadata
122
+ - name : Build Metadata
118
123
id : meta
119
124
uses : docker/metadata-action@v5
120
125
with :
121
126
images : ${{ secrets.DOCKER_ORG }}/pumba
122
127
tags : |
123
128
type=semver,pattern={{version}}
124
129
type=raw,value=latest
125
-
126
- - name : Build and push
127
- uses : docker/build-push-action@v5
130
+ - name : Build and Push Docker Image
131
+ uses : docker/build-push-action@v6
128
132
with :
129
133
file : docker/Dockerfile
130
134
context : .
131
135
build-args : |
132
136
BRANCH=${{ github.ref_name }}
133
- COMMIT=${{ steps.short-sha .outputs.sha }}
137
+ COMMIT=${{ steps.short_sha .outputs.sha }}
134
138
SKIP_TESTS=true
135
- platforms : |
136
- linux/amd64
137
- linux/arm64
139
+ platforms : linux/amd64,linux/arm64
138
140
push : true
139
141
tags : ${{ steps.meta.outputs.tags }}
140
142
labels : ${{ steps.meta.outputs.labels }}
141
143
cache-from : type=gha
142
144
cache-to : type=gha,mode=max
143
145
provenance : true
144
- sbom : true
146
+ sbom : true
0 commit comments