chore: add Cargo.lock for reproducible builds #5
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 CLI | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create release if missing | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1 || \ | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| --verify-tag \ | |
| --title "${GITHUB_REF_NAME}" | |
| upload-binaries: | |
| name: Upload ${{ matrix.target }} | |
| needs: create-release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| bin_suffix: "" | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| setup-cross: true | |
| bin_suffix: "" | |
| - os: macos-15-intel | |
| target: x86_64-apple-darwin | |
| bin_suffix: "" | |
| - os: macos-15 | |
| target: aarch64-apple-darwin | |
| bin_suffix: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| bin_suffix: ".exe" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Linux cross toolchain | |
| if: matrix.setup-cross | |
| uses: taiki-e/setup-cross-toolchain-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| runner: none | |
| - name: Build release binary | |
| shell: bash | |
| run: cargo build --release --locked --target "${{ matrix.target }}" | |
| - name: Prepare release asset | |
| shell: bash | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| TARGET: ${{ matrix.target }} | |
| BIN_SUFFIX: ${{ matrix.bin_suffix }} | |
| run: | | |
| mkdir -p dist | |
| cp "target/${TARGET}/release/mailclaw${BIN_SUFFIX}" \ | |
| "dist/mailclaw-${TAG}-${TARGET}${BIN_SUFFIX}" | |
| - name: Upload release asset | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| TAG: ${{ github.ref_name }} | |
| TARGET: ${{ matrix.target }} | |
| BIN_SUFFIX: ${{ matrix.bin_suffix }} | |
| run: | | |
| gh release upload "${TAG}" \ | |
| "dist/mailclaw-${TAG}-${TARGET}${BIN_SUFFIX}" \ | |
| --clobber |