5
5
6
6
on :
7
7
release :
8
- types : [ published ]
8
+ types : [published]
9
9
# Trigger only when a release with tag v*.*.* is published
10
10
tags :
11
11
- ' v[0-9]+.[0-9]+.[0-9]+'
@@ -14,24 +14,26 @@ jobs:
14
14
update-version :
15
15
runs-on : ubuntu-latest
16
16
steps :
17
- - uses : actions/checkout@v3
17
+ - uses : actions/checkout@v4
18
+
18
19
- name : Update version in package.json
19
20
run : |
20
21
CURRENT_TAG=${GITHUB_REF#refs/tags/}
21
- echo "Current tag: $CURRENT_TAG"
22
22
VERSION="${CURRENT_TAG#v}"
23
23
echo "Updating version to: $VERSION"
24
24
jq ".version = \"$VERSION\"" package.json > package.json.tmp
25
25
mv package.json.tmp package.json
26
+
26
27
- name : Create Pull Request
27
- uses : peter-evans/create-pull-request@v4
28
+ uses : peter-evans/create-pull-request@v7
28
29
with :
29
- title : Update package.json version
30
+ title : " Update package.json version"
30
31
branch : update-version
31
- commit-message : Update package.json version
32
- body : Update the version of `package.json` as part of release process
32
+ commit-message : " Update package.json version"
33
+ body : " Update the version of \ ` package.json\ ` as part of the release process. "
33
34
delete-branch : true
34
35
base : main
36
+
35
37
build :
36
38
runs-on : ubuntu-latest
37
39
permissions :
@@ -41,43 +43,36 @@ jobs:
41
43
pull-requests : write
42
44
43
45
steps :
44
- - uses : actions/checkout@v3
46
+ - uses : actions/checkout@v4
45
47
46
- # Install the cosign tool except on PR
47
- # https://github.com/sigstore/cosign-installer
48
48
- name : Install cosign
49
49
if : github.event_name != 'pull_request'
50
- uses : sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 # v2.6.0
50
+ uses : sigstore/cosign-installer@v3
51
51
with :
52
- cosign-release : ' v1.13.1 '
52
+ cosign-release : ' v2.0.0 '
53
53
54
- # Workaround: https://github.com/docker/build-push-action/issues/461
55
- - name : Setup Docker buildx
56
- uses : docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
54
+ - name : Setup Docker Buildx
55
+ uses : docker/setup-buildx-action@v3
57
56
58
- # Login against a Docker registry except on PR
59
- # https://github.com/docker/login-action
60
57
- name : Log into registry ${{ env.REGISTRY }}
61
58
if : github.event_name != 'pull_request'
62
- uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
59
+ uses : docker/login-action@v3
63
60
with :
64
61
registry : ${{ env.REGISTRY }}
65
62
username : ${{ github.actor }}
66
63
password : ${{ secrets.GITHUB_TOKEN }}
67
64
68
- # Extract metadata (tags, labels) for Docker
69
- # https://github.com/docker/metadata-action
70
65
- name : Extract Docker metadata
71
66
id : meta
72
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
67
+ uses : docker/metadata-action@v5
73
68
with :
74
69
images : ${{ env.REGISTRY }}/${{ github.repository }}
75
70
76
71
# Build and push Docker image with Buildx (don't push on PR)
77
72
# https://github.com/docker/build-push-action
78
73
- name : Build and push Docker image
79
74
id : build-and-push
80
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
75
+ uses : docker/build-push-action@v5
81
76
with :
82
77
context : .
83
78
push : ${{ github.event_name != 'pull_request' }}
86
81
cache-from : type=gha
87
82
cache-to : type=gha,mode=max
88
83
89
-
90
- # Sign the resulting Docker image digest except on PRs.
91
- # This will only write to the public Rekor transparency log when the Docker
92
- # repository is public to avoid leaking data. If you would like to publish
93
- # transparency data even for private images, pass --force to cosign below.
94
- # https://github.com/sigstore/cosign
95
84
- name : Sign the published Docker image
96
85
if : ${{ github.event_name != 'pull_request' }}
97
86
env :
98
87
COSIGN_EXPERIMENTAL : " true"
99
- # This step uses the identity token to provision an ephemeral certificate
100
- # against the sigstore community Fulcio instance.
101
88
run : echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
0 commit comments