Merge pull request #10 from codesoda/feat/docs-site #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 | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| check: | |
| name: CI checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Rust checks | |
| run: cargo fmt --check && cargo clippy -- -D warnings && cargo build && cargo test | |
| build: | |
| name: Build ${{ matrix.target }} | |
| needs: check | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build release binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package artifact | |
| shell: bash | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/}" | |
| name="bugatti-${tag}-${{ matrix.target }}" | |
| mkdir -p "dist/${name}" | |
| cp "target/${{ matrix.target }}/release/bugatti" "dist/${name}/" | |
| cd dist | |
| tar czf "${name}.tar.gz" "${name}" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bugatti-${{ matrix.target }} | |
| path: dist/*.tar.gz | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| sha256sum *.tar.gz > checksums-sha256.txt | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/}" | |
| gh release create "${tag}" \ | |
| --title "${tag}" \ | |
| --generate-notes \ | |
| --draft \ | |
| artifacts/*.tar.gz \ | |
| artifacts/checksums-sha256.txt |