Merge pull request #2 from splitgraph/feat/numeric-support #6
Workflow file for this run
This file contains 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: Build and upload releases | |
on: | |
# For pushes to main, build binaries and store them as artifacts (also upload Docker images) | |
# For pushes to main with tags, also make a GitHub release. | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
jobs: | |
build_binary: | |
name: Build the binaries | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [linux-x86_64, macos-arm64] | |
include: | |
- build: linux-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- build: macos-arm64 | |
os: macos-14 | |
target: arm64-apple-darwin | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- run: | | |
rustup toolchain install nightly --profile minimal | |
rustup default nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: "true" | |
- name: Build the release binary | |
shell: bash | |
run: | | |
cargo build --release | |
- name: Test invoking the binary | |
shell: bash | |
run: | | |
./target/release/lakehouse-loader --help || exit 1 | |
- name: Prepare artifact name | |
shell: bash | |
run: | | |
echo "ARTIFACT=lakehouse-loader-nightly-${{ matrix.target }}" >> $GITHUB_ENV | |
echo "SOURCE=target/release/lakehouse-loader" >> $GITHUB_ENV | |
- name: Upload binaries as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: ${{ env.SOURCE }} | |
github_release: | |
name: Perform GitHub release | |
needs: build_binary | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
steps: | |
- name: Get the release version from the tag | |
shell: bash | |
if: env.RELEASE_VERSION == '' | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
echo "version is: ${{ env.RELEASE_VERSION }}" | |
- name: Get artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Package artifacts | |
run: | | |
chmod +x artifacts/lakehouse-loader-nightly-x86_64-unknown-linux-gnu/lakehouse-loader | |
tar -C artifacts/lakehouse-loader-nightly-x86_64-unknown-linux-gnu -czf lakehouse-loader-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz lakehouse-loader | |
tar -C artifacts/lakehouse-loader-nightly-arm64-apple-darwin -czf lakehouse-loader-${{ env.RELEASE_VERSION }}-arm64-apple-darwin.tar.gz lakehouse-loader | |
- name: Upload release archive | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
lakehouse-loader-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | |
lakehouse-loader-${{ env.RELEASE_VERSION }}-arm64-apple-darwin.tar.gz |