Skip to content

Commit

Permalink
Add github build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fioncat committed Jan 24, 2024
1 parent 8529b35 commit 44fd285
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 15 deletions.
Empty file.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

on:
push:
branches:
- "main"
- "build-*"

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}


build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}

steps:
- name: Installing Dependencies
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get install libx11-xcb-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

- uses: taiki-e/upload-rust-binary-action@v4
with:
bin: csync,csyncd
tar: unix
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}
Empty file added Makefile
Empty file.
22 changes: 22 additions & 0 deletions csync/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:22.04 AS builder

RUN apt-get update
RUN apt-get install -y libx11-xcb-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
RUN apt-get install -y git gcc curl

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup-init.sh \
&& chmod u+x /tmp/rustup-init.sh \
&& sh /tmp/rustup-init.sh -y \
&& rm /tmp/rustup-init.sh

WORKDIR /usr/src/sync
COPY . .

RUN ~/.cargo/bin/cargo build --release --package csync --target x86_64-unknown-linux-gnu --locked
RUN mv ./target/x86_64-unknown-linux-gnu/release/csync ~/.cargo/bin/csync

FROM ubuntu:22.04

COPY --from=builder /root/.cargo/bin/csync /usr/local/bin

ENTRYPOINT [ "/usr/local/bin/csync" ]
2 changes: 0 additions & 2 deletions csyncd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ FROM rust:1.75-alpine3.19 AS builder
WORKDIR /usr/src/csync
COPY . .

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache musl-dev git

RUN mv ./csyncd/docker-cargo.toml /usr/local/cargo/config
RUN cargo build --release --package csyncd --target x86_64-unknown-linux-musl --locked
RUN mv ./target/x86_64-unknown-linux-musl/release/csyncd /usr/local/cargo/bin/csyncd

Expand Down
13 changes: 0 additions & 13 deletions csyncd/docker-cargo.toml

This file was deleted.

Empty file added csyncd/k8s.yaml
Empty file.

0 comments on commit 44fd285

Please sign in to comment.