feat: add PowerShell install script and Windows instructions #121
Workflow file for this run
This file contains hidden or 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: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.asset_name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: scud | |
| asset_name: scud-linux-x64 | |
| use_cross: false | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| artifact_name: scud | |
| asset_name: scud-linux-arm64 | |
| use_cross: true | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact_name: scud | |
| asset_name: scud-macos-x64 | |
| use_cross: false | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| artifact_name: scud | |
| asset_name: scud-macos-arm64 | |
| use_cross: false | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: scud.exe | |
| asset_name: scud-windows-x64.exe | |
| use_cross: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build with cross | |
| if: matrix.use_cross | |
| run: cross build --release --target ${{ matrix.target }} -p scud-cli | |
| - name: Build with cargo | |
| if: "!matrix.use_cross" | |
| run: cargo build --release --target ${{ matrix.target }} -p scud-cli | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Create Release | |
| run: gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --generate-notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Assets | |
| run: | | |
| for asset_dir in ./artifacts/*; do | |
| if [ -d "$asset_dir" ]; then | |
| asset_name=$(basename "$asset_dir") | |
| asset_file=$(find "$asset_dir" -type f -name "scud*" | head -1) | |
| if [ -n "$asset_file" ]; then | |
| echo "Uploading $asset_file as $asset_name" | |
| cp "$asset_file" "./$asset_name" | |
| gh release upload ${{ github.ref_name }} "./$asset_name" --clobber | |
| fi | |
| fi | |
| done | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |