Build & Release iox musl #98
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 & Release iox musl | |
on: | |
workflow_dispatch: | |
release: | |
types: [created] | |
schedule: | |
# build nightly version | |
- cron: '30 5, * * *' | |
jobs: | |
build_iox_linux: | |
name: ubuntu-20.04 | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Check out iox | |
uses: actions/checkout@v3 | |
with: | |
repository: influxdata/influxdb_iox | |
- run: | | |
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
- run: sudo apt update && sudo apt install -y musl-tools | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v1.2.0 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: x86_64-unknown-linux-musl | |
# - name: Set up cargo cache | |
# uses: actions/cache@v3 | |
# continue-on-error: false | |
# with: | |
# path: | | |
# ~/.cargo/bin/ | |
# ~/.cargo/registry/index/ | |
# ~/.cargo/registry/cache/ | |
# ~/.cargo/git/db/ | |
# target/ | |
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# restore-keys: ${{ runner.os }}-cargo- | |
- name: Update | |
uses: actions-rs/cargo@v1 | |
with: | |
command: update | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target x86_64-unknown-linux-musl --features aws,default | |
- name: Check Target | |
run: | | |
ls -alFh ./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
ldd ./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
- name: Compress iox | |
run: | | |
strip ./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
upx ./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
- name: Upload release | |
if: github.event_name != 'pull_request' | |
uses: boxpositron/upload-multiple-releases@1.0.7 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_config: | | |
./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
tag_name: ${{ env.VERSION }} | |
release_name: iox-musl_${{ env.VERSION }} | |
draft: false | |
prerelease: false | |
overwrite: true | |
- uses: actions/upload-artifact@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
name: iox-musl | |
path: ./target/x86_64-unknown-linux-musl/release/influxdb_iox | |
build_iox_docker: | |
if: github.event_name != 'pull_request' | |
needs: build_iox_linux | |
name: docker | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Check out iox | |
uses: actions/checkout@v3 | |
- name: Log in to the GHCR registry | |
uses: docker/login-action@v2.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker Build and push (server) | |
uses: docker/build-push-action@v4.0.0 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/metrico/iox-musl:latest |