Publish release #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Publish new release of tfhe-rs on various platform. | |
name: Publish release | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: "Dry-run" | |
type: boolean | |
default: true | |
push_to_crates: | |
description: "Push to crate" | |
type: boolean | |
default: true | |
push_web_package: | |
description: "Push web js package" | |
type: boolean | |
default: true | |
push_node_package: | |
description: "Push node js package" | |
type: boolean | |
default: true | |
env: | |
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
jobs: | |
publish_release: | |
name: Publish Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
fetch-depth: 0 | |
- name: Publish crate.io package | |
if: ${{ inputs.push_to_crates }} | |
env: | |
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }} | |
run: | | |
cargo publish -p tfhe --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }} | |
- name: Build web package | |
if: ${{ inputs.push_web_package }} | |
run: | | |
make build_web_js_api | |
- name: Publish web package | |
if: ${{ inputs.push_web_package }} | |
uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: tfhe/pkg/package.json | |
dry-run: ${{ inputs.dry_run }} | |
- name: Build Node package | |
if: ${{ inputs.push_node_package }} | |
run: | | |
rm -rf tfhe/pkg | |
make build_node_js_api | |
sed -i 's/"tfhe"/"node-tfhe"/g' tfhe/pkg/package.json | |
- name: Publish Node package | |
if: ${{ inputs.push_node_package }} | |
uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: tfhe/pkg/package.json | |
dry-run: ${{ inputs.dry_run }} | |
- name: Slack Notification | |
if: ${{ failure() }} | |
continue-on-error: true | |
uses: rtCamp/action-slack-notify@b24d75fe0e728a4bf9fc42ee217caa686d141ee8 | |
env: | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png | |
SLACK_MESSAGE: "tfhe release failed: (${{ env.ACTION_RUN_URL }})" | |
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |