Skip to content

Commit

Permalink
Add release action and upgrade parquet module (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jupiter authored Jan 8, 2022
1 parent 187432e commit 44eebcc
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 64 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Release Binaries

on:
release:
types: [published]

jobs:
# adapted from https://github.com/starship/starship/blob/master/.github/workflows/deploy.yml

github_build:
name: Build release binaries
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: parquet2json-x86_64-unknown-linux-gnu.tar.gz

- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: parquet2json-x86_64-unknown-linux-musl.tar.gz

- target: i686-unknown-linux-musl
os: ubuntu-latest
name: parquet2json-i686-unknown-linux-musl.tar.gz

- target: aarch64-unknown-linux-musl
os: ubuntu-latest
name: parquet2json-aarch64-unknown-linux-musl.tar.gz

- target: arm-unknown-linux-musleabihf
os: ubuntu-latest
name: parquet2json-arm-unknown-linux-musleabihf.tar.gz

- target: x86_64-apple-darwin
os: macOS-latest
name: parquet2json-x86_64-apple-darwin.tar.gz

- target: aarch64-apple-darwin
os: macOS-latest
name: parquet2json-aarch64-apple-darwin.tar.gz

- target: x86_64-pc-windows-msvc
os: windows-latest
name: parquet2json-x86_64-pc-windows-msvc.zip

- target: i686-pc-windows-msvc
os: windows-latest
name: parquet2json-i686-pc-windows-msvc.zip

- target: aarch64-pc-windows-msvc
os: windows-latest
name: parquet2json-aarch64-pc-windows-msvc.zip

runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2

# Cache files between builds
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: beta
override: true
profile: minimal
target: ${{ matrix.target }}

- name: Build
uses: actions-rs/cargo@v1
# TODO: Remove this once it's the default
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
with:
command: build
args: --release --target ${{ matrix.target }}
use-cross: ${{ matrix.os == 'ubuntu-latest' }}

- name: Prepare artifacts [Windows]
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip parquet2json.exe
7z a ../../../${{ matrix.name }} parquet2json.exe
cd -
- name: Prepare artifacts [-nix]
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip parquet2json || true
tar czvf ../../../${{ matrix.name }} parquet2json
cd -
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_name: ${{ matrix.name }}
asset_path: ${{ matrix.name }}
upload_url: ${{ github.event.release.upload_url }}
asset_content_type: application/octet-stream
127 changes: 65 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ repository = "https://github.com/jupiter/parquet2json"
bytes = { version = "1.0.1" }
chunked-bytes = { version = "0.3.0" }
crossbeam-channel = { version = "0.5.1" }
clap = "2.33.3"
clap = "2.34.0"
lazy_static = { version = "1.4.0" }
parquet = { version = "5.2.0", features = ["cli"] }
parquet = { version = "6.5.0", features = ["cli"] }
regex = { version = "1.5.4" }
reqwest = { version = "0.11", features = ["blocking"] }
rusoto_core = { version = "0.47.0", default_features = false, features=["rustls"] }
Expand Down

0 comments on commit 44eebcc

Please sign in to comment.