v1.0.0 release #1
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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| runner: macos-latest | |
| asset_name: svg-strip-macos-x86_64 | |
| - target: aarch64-apple-darwin | |
| runner: macos-latest | |
| asset_name: svg-strip-macos-aarch64 | |
| - target: x86_64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| asset_name: svg-strip-linux-x86_64 | |
| use_upx: true | |
| - target: aarch64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| asset_name: svg-strip-linux-aarch64 | |
| use_cross: true | |
| use_upx: true | |
| - target: x86_64-pc-windows-msvc | |
| runner: windows-latest | |
| asset_name: svg-strip.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross (Linux aarch64) | |
| if: matrix.use_cross == true | |
| uses: taiki-e/install-action@cross | |
| - name: Build (cross) | |
| if: matrix.use_cross == true | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Build (cargo) | |
| if: matrix.use_cross != true | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Compress binary with UPX (Linux) | |
| if: matrix.use_upx == true && matrix.runner == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y upx-ucl | |
| upx --best --lzma target/${{ matrix.target }}/release/svg-strip | |
| - name: Rename binary (Unix) | |
| if: matrix.runner != 'windows-latest' | |
| run: cp target/${{ matrix.target }}/release/svg-strip ${{ matrix.asset_name }} | |
| - name: Rename binary (Windows) | |
| if: matrix.runner == 'windows-latest' | |
| run: cp target/${{ matrix.target }}/release/svg-strip.exe ${{ matrix.asset_name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: ${{ matrix.asset_name }} | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |