Skip to content

Commit

Permalink
update build WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraettinger committed Mar 30, 2023
1 parent d602489 commit ede1e25
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 771 deletions.
1 change: 0 additions & 1 deletion .devcontainer/github-ubuntu-2004.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ RUN apt update -y \
libssl-dev \
lld-12 \
locales \
musl-tools \
net-tools \
netcat \
openssh-client \
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/flowctl-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,15 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Linux build steps:
# Linux builds need the non-default musl target.
- name: Install Rust
if: matrix.config.os == 'ubuntu-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Build Linux
if: matrix.config.os == 'ubuntu-latest'
run: |-
sudo apt-get update && \
sudo apt-get install -y musl-tools && \
cargo build -p flowctl --release --target x86_64-unknown-linux-musl && \
mv target/x86_64-unknown-linux-musl/release/flowctl ${ASSET_NAME}
cargo build -p flowctl --release && mv target/release/flowctl ${ASSET_NAME}
# Mac build steps:
# We need multiple targets for mac builds, so they will be manually added
Expand Down Expand Up @@ -78,12 +73,12 @@ jobs:
security import "$CERTIFICATE_PATH" -P "$MAC_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security find-identity -v
security list-keychain -d user -s "$KEYCHAIN_PATH"
# allow the codesign utility to use this keychain without triggering a prompt. Taken from:
# https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
# This one mac build runs on both intel and m1 macs
- name: Build Mac
if: matrix.config.os == 'macos-latest'
Expand Down
92 changes: 29 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
cancel-in-progress: true

jobs:
gnu-binaries:
all-binaries:
runs-on: ubuntu-20.04

steps:
Expand Down Expand Up @@ -68,8 +68,8 @@ jobs:
# Build and test all the things.
- run: make install-tools
- run: go mod download
- run: make rust-gnu-test
- run: make linux-gnu-binaries
- run: make rust-test
- run: make all-binaries

- name: Ensure that generated files are unchanged.
run: |
Expand All @@ -80,53 +80,16 @@ jobs:
- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
name: linux-gnu-binaries
name: all-binaries
path: |
.build/package/bin/*
target/x86_64-unknown-linux-gnu/release/libbindings.a
target/release/libbindings.a
crates/bindings/flow_bindings.h
target/x86_64-unknown-linux-gnu/release/librocksdb-exp/
musl-binaries:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.66.1
default: true
target: x86_64-unknown-linux-musl
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- run: make extra-ci-runner-setup
- run: make print-versions

- uses: Swatinem/rust-cache@v2

# Build and test all the things.
- run: go mod download
- run: make rust-musl-test
- run: make linux-musl-binaries

- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
name: linux-musl-binaries
path: |
.build/package/bin/*
target/release/librocks-exp/
assembly:
runs-on: ubuntu-20.04
needs: [gnu-binaries, musl-binaries]
needs: [all-binaries]

services:
postgres:
Expand Down Expand Up @@ -181,28 +144,18 @@ jobs:
echo "${{ secrets.GITHUB_TOKEN }}" | \
docker login --username ${{ github.actor }} --password-stdin ghcr.io
- name: Download gnu-linux-binaries
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: linux-gnu-binaries
path: linux-gnu-binaries
- name: Move linux-gnu-binaries to PKGBIN
name: all-binaries
path: fetched
- name: Move all-binaries to PKGBIN
run: |
mkdir -p .build/package/bin && \
mv linux-gnu-binaries/.build/package/bin/* .build/package/bin && \
mkdir -p target/x86_64-unknown-linux-gnu/release && \
mv -f linux-gnu-binaries/target/x86_64-unknown-linux-gnu/release/* target/x86_64-unknown-linux-gnu/release/ && \
mv -f linux-gnu-binaries/crates/bindings/flow_bindings.h crates/bindings/
- name: Download linux-musl-binaries
uses: actions/download-artifact@v2
with:
name: linux-musl-binaries
path: linux-musl-binaries
- name: Move linux-musl-binaries to PKGBIN
run: |
mkdir -p .build/package/bin && \
mv linux-musl-binaries/* .build/package/bin
mv fetched/.build/package/bin/* .build/package/bin && \
mkdir -p target/release && \
mv -f fetched/target/release/* target/release/ && \
mv -f fetched/crates/bindings/flow_bindings.h crates/bindings/
# Downloaded artifacts lose their prior permission settings
- name: Adjust binaries permissions
Expand Down Expand Up @@ -234,7 +187,6 @@ jobs:
# Package and push images.
- run: make docker-image

# TODO(johnny) re-enable
- run: make docker-push
- if: ${{ github.ref == 'refs/heads/master' }}
run: make docker-push-dev
Expand All @@ -251,3 +203,17 @@ jobs:
tag_name: dev
generate_release_notes: false
files: .build/package/flow-x86-linux.tar.gz

# TODO remove me when merged.
- if: ${{ github.ref == 'refs/pull/985/merge' }}
name: Upload release assets (dev-sql)
uses: softprops/action-gh-release@v1
with:
body: |
This is the latest development build of the sql branch, which gets updated on every successful build of its branch.
target_commitish: ${{ github.sha }}
draft: false
prerelease: true
tag_name: dev-sql
generate_release_notes: false
files: .build/package/flow-x86-linux.tar.gz
Loading

0 comments on commit ede1e25

Please sign in to comment.