diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5a09ad..6948456 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,10 @@ concurrency: jobs: tag-release: runs-on: ubuntu-latest + outputs: + tag: ${{ steps.version.outputs.tag }} + version: ${{ steps.version.outputs.version }} + is_new: ${{ steps.check.outputs.exists == 'false' }} steps: - uses: actions/checkout@v4 with: @@ -55,3 +59,45 @@ jobs: tag_name: ${{ steps.version.outputs.tag }} name: ${{ steps.version.outputs.tag }} generate_release_notes: true + + build-binaries: + needs: tag-release + if: needs.tag-release.outputs.is_new == 'true' + strategy: + matrix: + include: + - os: macos-14 + target: aarch64-apple-darwin + - os: macos-13 + target: x86_64-apple-darwin + - os: ubuntu-24.04-arm + target: aarch64-unknown-linux-gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.tag-release.outputs.tag }} + + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Build + run: cargo build --release --locked --target ${{ matrix.target }} + + - name: Package + id: package + run: | + set -euo pipefail + name="git-task-${{ needs.tag-release.outputs.version }}-${{ matrix.target }}" + dir="target/${{ matrix.target }}/release" + tar -czf "${name}.tar.gz" -C "${dir}" git-task gtask + echo "asset=${name}.tar.gz" >> "$GITHUB_OUTPUT" + + - name: Upload to release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ needs.tag-release.outputs.tag }} + files: ${{ steps.package.outputs.asset }} diff --git a/Cargo.lock b/Cargo.lock index b876f96..cc6fdbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "git-task" -version = "1.0.1" +version = "1.0.2" dependencies = [ "anyhow", "assert_cmd", @@ -830,6 +830,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.6.1+3.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.117" @@ -838,6 +847,7 @@ checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index e33383e..b969107 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-task" -version = "1.0.1" +version = "1.0.2" edition = "2021" [lib] @@ -17,7 +17,7 @@ path = "src/bin/gtask.rs" [dependencies] clap = { version = "4", features = ["derive", "string"] } -git2 = "0.19" +git2 = { version = "0.19", features = ["vendored-openssl"] } serde = { version = "1", features = ["derive"] } serde_json = "1" toml = "0.8"