# This workflow releases the `matrix-sdk-crypto-js` project. # # It is triggered when a new tag appears that matches # `matrix-sdk-crypto-js-v[0-9]+.*`. This workflow builds the package # for the binding, run its tests to ensure everything is still # correct, and publish the package on NPM and on a newly created # Github release. name: Release `crypto-js` env: CARGO_TERM_COLOR: always PKG_PATH: "bindings/matrix-sdk-crypto-js" on: push: tags: - matrix-sdk-crypto-js-v[0-9]+.* jobs: publish-matrix-sdk-crypto-js: name: Publish 🕸 [m]-crypto-js runs-on: ubuntu-latest steps: - name: Checkout the repo uses: actions/checkout@v3 - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable target: wasm32-unknown-unknown profile: minimal override: true - name: Load cache uses: Swatinem/rust-cache@v1 - name: Install Node.js uses: actions/setup-node@v3 with: node-version: 18.0 - name: Install NPM dependencies working-directory: ${{ env.PKG_PATH }} run: npm install - name: Publish the WebAssembly + JavaScript binding (imply building + testing) uses: JS-DevTools/npm-publish@v1 with: package: ${{env.PKG_PATH}}/package.json access: public token: ${{ secrets.NPM_TOKEN }} - name: Create the Github release uses: softprops/action-gh-release@v1 with: draft: true files: ${{ env.PKG_PATH }}/pkg/matrix-org-matrix-sdk-crypto-js-*.tgz