Initial commit - extstat v0.1.0 #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-release: | |
| name: Build Release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: extstat | |
| asset_name: extstat-linux-x86_64 | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| artifact_name: extstat | |
| asset_name: extstat-linux-x86_64-musl | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact_name: extstat | |
| asset_name: extstat-macos-x86_64 | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| artifact_name: extstat | |
| asset_name: extstat-macos-aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl tools (Linux musl only) | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: sudo apt-get install -y musl-tools | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Strip binary (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| - name: Create archive | |
| run: | | |
| mkdir archive | |
| cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} archive/ | |
| cp README.md LICENSE archive/ | |
| cd archive | |
| tar czf ../${{ matrix.asset_name }}.tar.gz * | |
| - name: Upload binaries to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ matrix.asset_name }}.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| cargo-publish: | |
| name: Publish to crates.io | |
| runs-on: ubuntu-latest | |
| needs: build-release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish to crates.io | |
| run: cargo publish --token ${{ secrets.CARGO_TOKEN }} | |
| continue-on-error: true |