@@ -2,14 +2,13 @@ name: Publish tfhe-versionable release
2
2
3
3
on :
4
4
workflow_dispatch :
5
- inputs :
6
- dry_run :
7
- description : " Dry-run"
8
- type : boolean
9
- default : true
10
5
11
6
env :
12
7
ACTION_RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
8
+ SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
9
+ SLACK_ICON : https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
10
+ SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
11
+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
13
12
14
13
jobs :
15
14
verify_tag :
19
18
READ_ORG_TOKEN : ${{ secrets.READ_ORG_TOKEN }}
20
19
21
20
package-derive :
21
+ name : Package tfhe-versionable-derive Release
22
22
runs-on : ubuntu-latest
23
23
outputs :
24
24
hash : ${{ steps.hash.outputs.hash }}
53
53
base64-subjects : ${{ needs.package-derive.outputs.hash }}
54
54
55
55
publish_release-derive :
56
- name : Publish tfhe-versionable Release
57
- needs : [verify_tag, package-derive] # for comparing hashes
56
+ name : Publish tfhe-versionable-derive Release
57
+ needs : [ verify_tag, package-derive ] # for comparing hashes
58
58
runs-on : ubuntu-latest
59
59
steps :
60
60
- name : Checkout
72
72
env :
73
73
CRATES_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
74
74
run : |
75
- cargo publish -p tfhe-versionable-derive --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
75
+ cargo publish -p tfhe-versionable-derive --token ${{ env.CRATES_TOKEN }}
76
76
- name : Generate hash
77
77
id : published_hash
78
78
run : cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
@@ -82,24 +82,18 @@ jobs:
82
82
uses : rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
83
83
env :
84
84
SLACK_COLOR : failure
85
- SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
86
- SLACK_ICON : https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
87
85
SLACK_MESSAGE : " SLSA tfhe-versionable-derive - hash comparison failure: (${{ env.ACTION_RUN_URL }})"
88
- SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
89
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
90
86
- name : Slack Notification
91
87
if : ${{ failure() }}
92
88
continue-on-error : true
93
89
uses : rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
94
90
env :
95
91
SLACK_COLOR : ${{ job.status }}
96
- SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
97
- SLACK_ICON : https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
98
92
SLACK_MESSAGE : " tfhe-versionable-derive release finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
99
- SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
100
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
101
93
102
94
package :
95
+ name : Package tfhe-versionable Release
96
+ needs : publish_release-derive
103
97
runs-on : ubuntu-latest
104
98
outputs :
105
99
hash : ${{ steps.hash.outputs.hash }}
@@ -120,7 +114,7 @@ jobs:
120
114
run : cd target/package && echo "hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
121
115
122
116
provenance :
123
- needs : [ package]
117
+ needs : package
124
118
uses :
slsa-framework/slsa-github-generator/.github/workflows/[email protected]
125
119
permissions :
126
120
# Needed to detect the GitHub Actions environment
@@ -135,7 +129,7 @@ jobs:
135
129
136
130
publish_release :
137
131
name : Publish tfhe-versionable Release
138
- needs : [ package] # for comparing hashes
132
+ needs : package # for comparing hashes
139
133
runs-on : ubuntu-latest
140
134
steps :
141
135
- name : Checkout
@@ -151,32 +145,21 @@ jobs:
151
145
env :
152
146
CRATES_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
153
147
run : |
154
- cargo publish -p tfhe-versionable --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
155
-
148
+ cargo publish -p tfhe-versionable --token ${{ env.CRATES_TOKEN }}
156
149
- name : Generate hash
157
150
id : published_hash
158
151
run : cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
159
-
160
152
- name : Slack notification (hashes comparison)
161
153
if : ${{ needs.package.outputs.hash != steps.published_hash.outputs.pub_hash }}
162
154
continue-on-error : true
163
155
uses : rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
164
156
env :
165
157
SLACK_COLOR : failure
166
- SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
167
- SLACK_ICON : https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
168
158
SLACK_MESSAGE : " SLSA tfhe-versionable - hash comparison failure: (${{ env.ACTION_RUN_URL }})"
169
- SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
170
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
171
-
172
159
- name : Slack Notification
173
160
if : ${{ failure() }}
174
161
continue-on-error : true
175
162
uses : rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
176
163
env :
177
164
SLACK_COLOR : ${{ job.status }}
178
- SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
179
- SLACK_ICON : https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
180
165
SLACK_MESSAGE : " tfhe-versionable release finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})"
181
- SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
182
- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments