Skip to content

Commit 5d9af12

Browse files
committed
chore(ci): fix release workflow for tfhe-versionable
tfhe-versionable crate depends on tfhe-versionable-derive. Workflow, now ensure that derive crate is published before attempting to package tfhe-versionable. Dry-run option is removed since it cannot be use correctly due the reason aforementioned.
1 parent 32c9387 commit 5d9af12

File tree

1 file changed

+13
-30
lines changed

1 file changed

+13
-30
lines changed

.github/workflows/make_release_tfhe_versionable.yml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: Publish tfhe-versionable release
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
dry_run:
7-
description: "Dry-run"
8-
type: boolean
9-
default: true
105

116
env:
127
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 }}
1312

1413
jobs:
1514
verify_tag:
@@ -19,6 +18,7 @@ jobs:
1918
READ_ORG_TOKEN: ${{ secrets.READ_ORG_TOKEN }}
2019

2120
package-derive:
21+
name: Package tfhe-versionable-derive Release
2222
runs-on: ubuntu-latest
2323
outputs:
2424
hash: ${{ steps.hash.outputs.hash }}
@@ -53,8 +53,8 @@ jobs:
5353
base64-subjects: ${{ needs.package-derive.outputs.hash }}
5454

5555
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
5858
runs-on: ubuntu-latest
5959
steps:
6060
- name: Checkout
@@ -72,7 +72,7 @@ jobs:
7272
env:
7373
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
7474
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 }}
7676
- name: Generate hash
7777
id: published_hash
7878
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
@@ -82,24 +82,18 @@ jobs:
8282
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
8383
env:
8484
SLACK_COLOR: failure
85-
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
86-
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
8785
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 }}
9086
- name: Slack Notification
9187
if: ${{ failure() }}
9288
continue-on-error: true
9389
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
9490
env:
9591
SLACK_COLOR: ${{ job.status }}
96-
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
97-
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
9892
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 }}
10193

10294
package:
95+
name: Package tfhe-versionable Release
96+
needs: publish_release-derive
10397
runs-on: ubuntu-latest
10498
outputs:
10599
hash: ${{ steps.hash.outputs.hash }}
@@ -120,7 +114,7 @@ jobs:
120114
run: cd target/package && echo "hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
121115

122116
provenance:
123-
needs: [package]
117+
needs: package
124118
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
125119
permissions:
126120
# Needed to detect the GitHub Actions environment
@@ -135,7 +129,7 @@ jobs:
135129

136130
publish_release:
137131
name: Publish tfhe-versionable Release
138-
needs: [package] # for comparing hashes
132+
needs: package # for comparing hashes
139133
runs-on: ubuntu-latest
140134
steps:
141135
- name: Checkout
@@ -151,32 +145,21 @@ jobs:
151145
env:
152146
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
153147
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 }}
156149
- name: Generate hash
157150
id: published_hash
158151
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
159-
160152
- name: Slack notification (hashes comparison)
161153
if: ${{ needs.package.outputs.hash != steps.published_hash.outputs.pub_hash }}
162154
continue-on-error: true
163155
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
164156
env:
165157
SLACK_COLOR: failure
166-
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
167-
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
168158
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-
172159
- name: Slack Notification
173160
if: ${{ failure() }}
174161
continue-on-error: true
175162
uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
176163
env:
177164
SLACK_COLOR: ${{ job.status }}
178-
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
179-
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
180165
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

Comments
 (0)