chore: merge branch 'main' into prerelease/2.0.0 #117
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
- prerelease/* | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
version_or_publish: | |
name: Version packages or publish them to npmjs.com | |
runs-on: ubuntu-latest | |
outputs: | |
published: ${{ steps.changeset.outputs.published }} | |
version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: Register Git user | |
run: | | |
git config user.name rollups-contracts-bot | |
git config user.email [email protected] | |
- uses: ./.github/workflows/setup | |
- name: Create release PR or publish packages to npmjs.com | |
uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 | |
id: changeset | |
with: | |
setupGitUser: false | |
commit: "chore: version packages" | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Get version | |
id: get_version | |
run: jq -r '"version=\(.version)"' package.json >> "$GITHUB_OUTPUT" | |
rust_bindings: | |
name: Generate and publish Rust bindings | |
needs: version_or_publish | |
if: ${{ needs.version_or_publish.outputs.published == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: ./.github/workflows/setup | |
- name: Install Python dependencies | |
run: pip install yq | |
- name: Generate Rust bindings | |
run: | | |
forge bind \ | |
--crate-name cartesi-rollups-contracts \ | |
--crate-version "$VERSION" | |
env: | |
VERSION: ${{ needs.version_or_publish.outputs.version }} | |
- name: Edit Rust package manifest | |
working-directory: out/bindings | |
run: | | |
tomlq -ti '.package.license = "Apache-2.0"' Cargo.toml | |
tomlq -ti '.package.description = "Rust bindings for Cartesi Rollups smart contracts"' Cargo.toml | |
- name: Publish Rust package to crates.io | |
working-directory: out/bindings | |
run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |