diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3a0a6f6..7f20054 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,7 +11,10 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v4 @@ -26,6 +29,27 @@ jobs: --additional-properties=packageName=tellers_api_client,packageVersion=0.1.0,library=reqwest,supportAsync=true,reqwestClient=true --skip-validate-spec --strict-spec=false - name: Build - run: cargo build --verbose + run: cargo build --verbose --release - name: Run tests run: cargo test --verbose + - name: Package binary (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + mkdir -p dist + cp target/release/tellers dist/tellers + tar -czf tellers-linux.tar.gz -C dist tellers + - name: Package binary (Windows) + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + New-Item -ItemType Directory -Path dist -Force | Out-Null + Copy-Item -Path "target/release/tellers.exe" -Destination "dist/tellers.exe" + Compress-Archive -Path "dist/tellers.exe" -DestinationPath "tellers-windows.zip" -Force + - name: Upload packaged binary + uses: actions/upload-artifact@v4 + with: + name: tellers-${{ matrix.os }} + path: | + tellers-linux.tar.gz + tellers-macos.tar.gz + tellers-windows.zip