diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5158791..dcacc39c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,25 @@ jobs: RUST_BACKTRACE: "full" steps: + - name: Cleanup unused stuff + if: runner.os == 'Linux' + run: | + df -h / + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /opt/google/chrome \ + /opt/microsoft/msedge \ + /opt/microsoft/powershell \ + /opt/pipx \ + /usr/lib/mono \ + /usr/local/julia* \ + /usr/local/lib/android \ + /usr/local/lib/node_modules \ + /usr/local/share/chromium \ + /usr/local/share/powershell \ + /usr/share/dotnet \ + /usr/share/swift + df -h / - run: git config --system core.longpaths true if: runner.os == 'Windows' - uses: actions/checkout@v4 @@ -104,6 +123,24 @@ jobs: env: RUST_BACKTRACE: "full" steps: + - name: Cleanup unused stuff + run: | + df -h / + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /opt/google/chrome \ + /opt/microsoft/msedge \ + /opt/microsoft/powershell \ + /opt/pipx \ + /usr/lib/mono \ + /usr/local/julia* \ + /usr/local/lib/android \ + /usr/local/lib/node_modules \ + /usr/local/share/chromium \ + /usr/local/share/powershell \ + /usr/share/dotnet \ + /usr/share/swift + df -h / - uses: actions/checkout@v4 with: submodules: true diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index df1ea063..19da644b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -18,6 +18,24 @@ jobs: runs-on: ubuntu-latest steps: + - name: Cleanup unused stuff + run: | + df -h / + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /opt/google/chrome \ + /opt/microsoft/msedge \ + /opt/microsoft/powershell \ + /opt/pipx \ + /usr/lib/mono \ + /usr/local/julia* \ + /usr/local/lib/android \ + /usr/local/lib/node_modules \ + /usr/local/share/chromium \ + /usr/local/share/powershell \ + /usr/share/dotnet \ + /usr/share/swift + df -h / - uses: actions/checkout@v4 with: submodules: true @@ -41,6 +59,24 @@ jobs: runs-on: ubuntu-latest steps: + - name: Cleanup unused stuff + run: | + df -h / + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /opt/google/chrome \ + /opt/microsoft/msedge \ + /opt/microsoft/powershell \ + /opt/pipx \ + /usr/lib/mono \ + /usr/local/julia* \ + /usr/local/lib/android \ + /usr/local/lib/node_modules \ + /usr/local/share/chromium \ + /usr/local/share/powershell \ + /usr/share/dotnet \ + /usr/share/swift + df -h / - name: Write release version run: | VERSION=${GITHUB_REF_NAME#v} @@ -149,6 +185,25 @@ jobs: os: windows-latest steps: + - name: Cleanup unused stuff + if: runner.os == 'Linux' + run: | + df -h / + sudo rm -rf \ + "$AGENT_TOOLSDIRECTORY" \ + /opt/google/chrome \ + /opt/microsoft/msedge \ + /opt/microsoft/powershell \ + /opt/pipx \ + /usr/lib/mono \ + /usr/local/julia* \ + /usr/local/lib/android \ + /usr/local/lib/node_modules \ + /usr/local/share/chromium \ + /usr/local/share/powershell \ + /usr/share/dotnet \ + /usr/share/swift + df -h / - run: git config --system core.longpaths true if: runner.os == 'Windows' - name: Write release version (non-Windows) diff --git a/justfile b/justfile index 12f85685..46fe0dc1 100644 --- a/justfile +++ b/justfile @@ -34,14 +34,17 @@ build-wasm-components: cargo component build -p pulumi_wasm_example_docker --timings cargo component build -p pulumi_wasm_example_dependencies --timings cargo component build -p pulumi_wasm_example_multiple_providers --timings - # DO NOT EDIT - BUILD-WASM-COMPONENTS - START + just build-wasm-providers + cargo build -p pulumi_wasm_runner --timings + +# DO NOT EDIT - BUILD-WASM-COMPONENTS - START +build-wasm-providers: cargo component build \ -p pulumi_wasm_docker_provider \ -p pulumi_wasm_random_provider \ -p pulumi_wasm_cloudflare_provider \ --timings - # DO NOT EDIT - BUILD-WASM-COMPONENTS - END - cargo build -p pulumi_wasm_runner --timings +# DO NOT EDIT - BUILD-WASM-COMPONENTS - END check: cargo fmt --all -- --check @@ -76,9 +79,15 @@ publish: cargo publish -p pulumi_wasm_generator_lib --allow-dirty --all-features cargo publish -p pulumi_wasm_generator --allow-dirty --all-features cargo publish -p pulumi_wasm_core --allow-dirty --all-features - cargo publish -p pulumi_wasm_docker --allow-dirty --all-features - cargo publish -p pulumi_wasm_random --allow-dirty --all-features cargo publish -p pulumi_wasm_runner --allow-dirty --all-features + just publish-providers + +# DO NOT EDIT - PUBLISH-PROVIDERS - START +publish-providers: + cargo publish -p pulumi_wasm_docker + cargo publish -p pulumi_wasm_random + cargo publish -p pulumi_wasm_cloudflare +# DO NOT EDIT - PUBLISH-PROVIDERS - END test: cargo nextest run --workspace --timings diff --git a/regenerate_providers/src/main.rs b/regenerate_providers/src/main.rs index b64ee549..bf3e6421 100644 --- a/regenerate_providers/src/main.rs +++ b/regenerate_providers/src/main.rs @@ -68,6 +68,7 @@ fn update_justfile(providers: &[Provider]) { let content = fs::read_to_string("justfile").expect("Failed to read justfile"); let content = replace_regenerate_providers(providers, &content); let content = replace_build_wasm_components(providers, &content); + let content = replace_publish_wasm_components(providers, &content); fs::write("justfile", content).expect("Failed to write to justfile"); } @@ -86,6 +87,8 @@ fn replace_regenerate_providers(providers: &[Provider], content: &str) -> String fn replace_build_wasm_components(providers: &[Provider], content: &str) -> String { let mut replacement = String::new(); + replacement.push_str("build-wasm-providers:\n"); + replacement.push_str(" cargo component build \\\n"); for provider in providers { replacement.push_str(&format!( " -p pulumi_wasm_{}_provider \\\n", @@ -93,9 +96,22 @@ fn replace_build_wasm_components(providers: &[Provider], content: &str) -> Strin )); } replacement.push_str(" --timings\n"); - let start_marker = - " # DO NOT EDIT - BUILD-WASM-COMPONENTS - START\n cargo component build \\"; - let end_marker = " # DO NOT EDIT - BUILD-WASM-COMPONENTS - END"; + let start_marker = "# DO NOT EDIT - BUILD-WASM-COMPONENTS - START"; + let end_marker = "# DO NOT EDIT - BUILD-WASM-COMPONENTS - END"; + replace_between_markers(content, start_marker, end_marker, &replacement) +} + +fn replace_publish_wasm_components(providers: &[Provider], content: &str) -> String { + let mut replacement = String::new(); + replacement.push_str("publish-providers:\n"); + for provider in providers { + replacement.push_str(&format!( + " cargo publish -p pulumi_wasm_{}\n", + provider.name + )); + } + let start_marker = "# DO NOT EDIT - PUBLISH-PROVIDERS - START"; + let end_marker = "# DO NOT EDIT - PUBLISH-PROVIDERS - END"; replace_between_markers(content, start_marker, end_marker, &replacement) }