feat(cli): use cartesi/sdk for anvil/devnet at run command #3
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 | |
permissions: | |
actions: write | |
contents: write | |
id-token: write | |
packages: write | |
pull-requests: write | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
outputs: | |
published: ${{ steps.changeset.outputs.published }} | |
publishedPackages: ${{ steps.changeset.outputs.publishedPackages }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v3 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Create Release Pull Request | |
id: changeset | |
uses: changesets/action@v1 | |
with: | |
commit: "release: version packages" | |
publish: pnpm run publish-packages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
packages_to_build: | |
name: Get released packages | |
runs-on: ubuntu-latest | |
needs: release | |
if: ${{ needs.release.outputs.published == 'true' }} | |
outputs: | |
packages: ${{ steps.packages.outputs.PACKAGES }} | |
steps: | |
- name: Get released packages | |
id: packages | |
run: | | |
echo "PACKAGES=$(jq -c '[ .[].name ]' <(echo '${{ needs.release.outputs.publishedPackages }}'))" >> "$GITHUB_OUTPUT" | |
build_sdk: | |
name: Build sdk | |
needs: [release, packages_to_build] | |
if: ${{ needs.release.outputs.published == 'true' && contains(fromJSON(needs.packages_to_build.outputs.packages), '@cartesi/sdk') }} | |
uses: ./.github/workflows/sdk.yaml | |
secrets: inherit | |
build_devnet: | |
name: Build devnet | |
needs: [release, packages_to_build] | |
if: ${{ needs.release.outputs.published == 'true' && contains(fromJSON(needs.packages_to_build.outputs.packages), '@cartesi/devnet') }} | |
uses: ./.github/workflows/devnet.yaml | |
secrets: inherit | |
with: | |
release: true | |
build_cli: | |
name: Build cli | |
needs: [release, packages_to_build] | |
if: ${{ needs.release.outputs.published == 'true' && contains(fromJSON(needs.packages_to_build.outputs.packages), '@cartesi/cli') }} | |
uses: ./.github/workflows/cli.yaml | |
secrets: inherit | |
with: | |
release: true |