feat: add CI/CD pipeline with auto-versioning, security audits, and c… #1
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: | |
| branches: [master] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| release-type: rust | |
| # ── Build release binaries for Linux, macOS, Windows ──────────── | |
| build-binaries: | |
| name: Build (${{ matrix.target }}) | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact: minibuild | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| artifact: minibuild | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| artifact: minibuild | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| artifact: minibuild.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release --locked --target ${{ matrix.target }} | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../minibuild-${{ needs.release-please.outputs.tag_name }}-${{ matrix.target }}.tar.gz ${{ matrix.artifact }} | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| Compress-Archive -Path ${{ matrix.artifact }} -DestinationPath ../../../minibuild-${{ needs.release-please.outputs.tag_name }}-${{ matrix.target }}.zip | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.release-please.outputs.tag_name }} | |
| files: | | |
| minibuild-*.tar.gz | |
| minibuild-*.zip |