Skip to content

Commit

Permalink
feat(build): Add basic release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zuston committed Dec 5, 2024
1 parent c651ed5 commit 3ef8b5e
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ReleaseBot

on:
push:
tags:
- "v*.*.*"

jobs:
build-snapshot:
name: Build Snapshot
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: prompt/actions-commit-hash@v3
id: commit

- uses: ScribeMD/[email protected]
if: steps.cache.outputs.cache-hit != 'true'

- uses: ScribeMD/[email protected]
if: steps.cache.outputs.cache-hit != 'true'
with:
key: docker-centos7-${{ hashFiles('dev/centos7/Dockerfile') }}

- name: Build
run: |
sed -i 's/docker-compose -f/docker compose -f/g' ./release.sh
./release.sh
- name: Upload
uses: actions/upload-artifact@v3
with:
name: uniffle-worker
path: target-docker/release/uniffle-worker
38 changes: 38 additions & 0 deletions dev/centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM centos:7

# install common tools
RUN echo "sslverify=false" >> /etc/yum.conf
RUN sed -i "s/mirror.centos.org/vault.centos.org/g" /etc/yum.repos.d/*.repo
RUN sed -i "s/^#.*baseurl=http/baseurl=https/g" /etc/yum.repos.d/*.repo
RUN sed -i "s/^mirrorlist/#mirrorlist/g" /etc/yum.repos.d/*.repo
RUN yum update -y
RUN yum install -y centos-release-scl epel-release
RUN sed -i "s/mirror.centos.org/vault.centos.org/g" /etc/yum.repos.d/*.repo
RUN sed -i "s/^#.*baseurl=http/baseurl=https/g" /etc/yum.repos.d/*.repo
RUN sed -i "s/^mirrorlist/#mirrorlist/g" /etc/yum.repos.d/*.repo
RUN yum install -y libzip unzip wget cmake3 openssl-devel llvm clang-devel clang jemalloc

# install gcc-8
RUN yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++
RUN echo '. /opt/rh/devtoolset-8/enable' >> ~/.bashrc

# install rust nightly toolchain
RUN curl https://sh.rustup.rs > /rustup-init
RUN chmod +x /rustup-init
RUN /rustup-init -y --default-toolchain nightly-2024-10-01-x86_64-unknown-linux-gnu

# install java
RUN yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
RUN echo 'export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"' >> ~/.bashrc

# install maven
# RUN yum install -y rh-maven35
# RUN echo 'source /opt/rh/rh-maven35/enable' >> ~/.bashrc

# install protoc
RUN wget -O /protobuf-21.7-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-linux-x86_64.zip
RUN mkdir /protobuf-bin && (cd /protobuf-bin && unzip /protobuf-21.7-linux-x86_64.zip)
RUN echo 'export PATH="$PATH:/protobuf-bin/bin"' >> ~/.bashrc

# attach libjvm.so
RUN echo 'export LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/amd64/server:${LD_LIBRARY_PATH}' >> ~/.bashrc
15 changes: 15 additions & 0 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
build-release:
build: ./centos7
volumes:
- ~/.m2:/root/.m2:rw
- ~/.sbt:/root/.sbt:rw
- ~/.cargo/git:/root/.cargo/git:rw
- ~/.cargo/registry:/root/.cargo/registry:rw
- ./../:/R1:rw
- ./../target-docker:/R1/target:rw
environment:
RUSTFLAGS: "-C target-cpu=skylake"
command: "bash -c 'source ~/.bashrc && cd /R1 && cargo build --release'"
3 changes: 3 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose -f dev/docker-compose.yml up

0 comments on commit 3ef8b5e

Please sign in to comment.