-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lorenzo Mangani <lorenzo.mangani@gmail.com>
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build & Release InfluxDB Edge 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 | ||
- 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: 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: edge-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/influxdb-edge-musl:latest |