1414 SLACK_CHANNEL : ${{ secrets.SLACK_CHANNEL }}
1515 SLACK_USERNAME : ${{ secrets.BOT_USERNAME }}
1616 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
17+ CRATE_BASE_DIR : ' frontends/concrete-rust/concrete-keygen/'
1718
1819permissions : {}
1920
@@ -31,15 +32,15 @@ jobs:
3132 - name : Prepare package
3233 run : |
3334 sudo apt install -y capnproto libcapnp-dev
34- cd frontends/concrete-rust/concrete-keygen/
35+ cd ${{ env.CRATE_BASE_DIR }}
3536 cargo package --features="wasm"
3637 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3738 with :
38- name : crate
39- path : target/package/*.crate
39+ name : concrete-keygen
40+ path : ${{ env.CRATE_BASE_DIR }}/ target/package/*.crate
4041 - name : generate hash
4142 id : hash
42- run : cd target/package && echo "hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
43+ run : cd ${{ env.CRATE_BASE_DIR }}/ target/package && echo "hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
4344
4445 provenance :
4546 if : ${{ !inputs.dry_run }}
@@ -68,14 +69,15 @@ jobs:
6869 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6970 with :
7071 fetch-depth : 0
71- persist-credentials : ' false '
72+ persist-credentials : ' true '
7273
7374 - name : Publish crate.io package
7475 env :
7576 CRATES_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
7677 DRY_RUN : ${{ inputs.dry_run && '--dry-run' || '' }}
7778 run : |
7879 sudo apt install -y capnproto libcapnp-dev
80+ cd ${{ env.CRATE_BASE_DIR }}
7981 # DRY_RUN expansion cannot be double quoted when variable contains empty string otherwise cargo publish
8082 # would fail. This is safe since DRY_RUN is handled in the env section above.
8183 # shellcheck disable=SC2086
@@ -96,13 +98,13 @@ jobs:
9698 gh release create --draft --repo ${{ github.repository }} \
9799 --verify-tag "${TAG}" \
98100 --title "${TAG}" \
99- target/package/*.crate
101+ ${{ env.CRATE_BASE_DIR }}/ target/package/*.crate
100102 env :
101103 GH_TOKEN : ${{ github.token }}
102104
103105 - name : Generate hash
104106 id : published_hash
105- run : cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
107+ run : cd ${{ env.CRATE_BASE_DIR }}/ target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
106108
107109 - name : Slack notification (hashes comparison)
108110 if : ${{ needs.package.outputs.hash != steps.published_hash.outputs.pub_hash }}
0 commit comments