Skip to content

Commit

Permalink
Merge pull request #1 from ivy-net/devops/gha-build
Browse files Browse the repository at this point in the history
Try new release
  • Loading branch information
wawrzek authored Sep 10, 2024
2 parents 419877d + 5a36f3f commit 2e248f3
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/sqlx-cli-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: SQLx CLI

on:
push:
branches:
- main
tags:
- "v*.*.*"

jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
# Note: macOS-latest uses M1 Silicon (ARM64)
os:
- ubuntu-latest
- windows-latest
- macOS-13
- macOS-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
args: --features openssl-vendored
bin: target/debug/cargo-sqlx
- os: windows-latest
target: x86_64-pc-windows-msvc
bin: target/debug/cargo-sqlx.exe
- os: macOS-13
target: x86_64-apple-darwin
bin: target/debug/cargo-sqlx
- os: macOS-latest
target: aarch64-apple-darwin
bin: target/debug/cargo-sqlx

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Use latest Rust
run: rustup override set stable
- name: Rust caching
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cli
- name: Build binaries
run: >
cargo build
--manifest-path sqlx-cli/Cargo.toml
--bin cargo-sqlx
${{ matrix.args }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

0 comments on commit 2e248f3

Please sign in to comment.