Skip to content

Commit

Permalink
Merge pull request #29 from manojkarthick/prepare-release
Browse files Browse the repository at this point in the history
Prepare release: v0.2.1
  • Loading branch information
manojkarthick authored May 14, 2022
2 parents 4af84d1 + 6d0f122 commit a5b02ee
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 107 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build

on: [pull_request]

jobs:
job_on_push:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true

- name: Test
uses: actions-rs/cargo@v1
with:
command: test

- name: Check compilation
uses: actions-rs/cargo@v1
with:
command: check
155 changes: 155 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Release

# Build on every semantic versioned tag
on:
push:
tags:
- 'v*'

jobs:
precheck:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.vars.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Version
id: vars
shell: bash
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)
echo ::set-output name=VERSION::$(echo "$version")
build:
name: 'Build ${{ matrix.job.target }}'
needs: [ precheck ]
strategy:
fail-fast: true
matrix:
job:
- { target: aarch64-apple-darwin , os: macos-11 , jreleaser_platform: osx-aarch_64 }
- { target: x86_64-apple-darwin , os: macos-11 , jreleaser_platform: osx-x86_64 }
- { target: x86_64-pc-windows-msvc , os: windows-2019 , jreleaser_platform: windows-x86_64 }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 , jreleaser_platform: linux-x86_64 }
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true, jreleaser_platform: linux-aarch_64 }
runs-on: ${{ matrix.job.os }}

steps:
- name: Checkout
uses: actions/checkout@v2

# Configure the Rust toolchain
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.job.target }}
override: true
profile: minimal # minimal component installation (ie, no documentation)

- name: Show version information (Rust, cargo, GCC)
shell: bash
run: |
gcc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --locked --release --target=${{ matrix.job.target }}

# Assemble the zipball
- name: Assemble
uses: jreleaser/release-action@v2
with:
version: early-access
arguments: assemble
env:
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_PLATFORM_OVERRIDE: ${{ matrix.job.jreleaser_platform }}
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.JRELEASER_HOMEBREW_GITHUB_TOKEN }}

# Upload archive
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: artifacts
path: |
out/jreleaser/assemble/pqrs/archive/*.zip
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v2
with:
name: jreleaser-output-${{ matrix.job.target }}
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
release:
needs: [ precheck, build ]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Release
uses: jreleaser/release-action@v2
with:
version: early-access
arguments: full-release -PartifactsDir=artifacts -PskipArchiveResolver
env:
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.JRELEASER_HOMEBREW_GITHUB_TOKEN }}

- name: JReleaser output
if: always()
uses: actions/upload-artifact@v2
with:
name: output-release-logs
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
universal:
needs: [ precheck, release ]
runs-on: ubuntu-latest

steps:
- name: Log in to Docker hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push universal binary
if: startsWith(github.ref, 'refs/tags/v')
uses: manojkarthick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
owner: "manojkarthick"
repository: "pqrs"
tag: "latest"
amd64: "x86_64-apple-darwin"
arm64: "aarch64-apple-darwin"
compressed: "true"
overwrite: "true"
universal-identifier: "all"
80 changes: 0 additions & 80 deletions .github/workflows/rust.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pqrs"
version = "0.2.0"
version = "0.2.1"
authors = ["Manoj Karthick"]
description = "Apache Parquet command-line tools and utilities"
edition = "2018"
Expand Down
Loading

0 comments on commit a5b02ee

Please sign in to comment.