midenup 1.1.0

The Miden toolchain manager
name: Integration

on:
  push:
    branches: [main, next]
    paths-ignore:
      - "**.md"
      - "**.txt"
      - "manifest/**"
      - "docs/**"
  pull_request:
    types: [opened, reopened, synchronize, labeled, unlabeled]
    paths-ignore:
      - "**.md"
      - "**.txt"
      - "manifest/**"
      - "docs/**"

env:
  # Set the new value when the cache grows too much and we hit the runner's disk space limit
  # via https://github.com/rust-lang/docs.rs/pull/2433
  RUST_CACHE_KEY: rust-cache-20260312

jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    permissions:
      contents: write
      artifact-metadata: write
    steps:
      - uses: actions/checkout@v5
      - name: Cache Cargo
        uses: Swatinem/rust-cache@v2
        with:
          # Use a common cache for the basic compilation/formatter/clippy checks
          shared-key: ${{ github.workflow }}-shared
          prefix-key: ${{ env.RUST_CACHE_KEY }}
          # Only update the cache on push onto the main branch. This strikes a nice balance between
          # cache hits and cache evictions (github has a 10GB cache limit).
          save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
      - name: Install cargo-make
        run: |
          if ! cargo make --version 2>/dev/null; then
            cargo install cargo-make --force
          fi
      - name: Build
        run: |
          rustup update --no-self-update
          make build-release
      - name: Upload
        uses: actions/upload-artifact@v4
        with:
          name: midenup_exe
          path: target/release/midenup

  install-stable:
    name: Install the stable toolchain via the CLI
    needs: [build]
    runs-on: ubuntu-latest
    permissions:
      contents: read
    if: ${{ github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'check:install') }}
    steps:
      - uses: actions/checkout@v4
      - name: Download midenup executable
        uses: actions/download-artifact@v4
        with:
          name: midenup_exe
          path: .
      - name: Mark midenup as executable
        run: |
          chmod +x midenup
      - name: install stable
        run: |
          ./midenup install stable