Skip to content

Commit

Permalink
Using docker for build release
Browse files Browse the repository at this point in the history
  • Loading branch information
Riey committed Jan 25, 2021
1 parent 1ae5062 commit b4483a8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.git
/target
/build
21 changes: 8 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ jobs:
- name: Set VER
id: version
run: echo "::set-output name=ver::$(grep '^version =' xtask/Cargo.toml|head -n1|cut -d\" -f2)"
- name: Update apt
run: sudo apt-get update -y
- name: Install packages
run: sudo apt-get install -y pkg-config libpango1.0-dev libcairo2-dev libgtk2.0-dev libgtk-3-dev libglib2.0 libxcb1 qt5-default qtbase5-dev qtbase5-private-dev libqt5gui5 cmake ninja-build
- name: Generate package...
run: cargo xtask build --build-path build XIM GTK3 QT5
- name: Archiving package...
run: 7z a build/kime.7z ./build/out/*
- name: Generate deb package...
run: cargo xtask release-deb build

- name: Make temp dir
run: mkdir /tmp/kime
- name: Build image
run: docker build --tag riey/kime --network=host .
- name: Run release image
run: docker run --network=host -v /tmp/kime:/opt/kime-out riey/kime
- name: Create draft release
id: create_release
uses: actions/create-release@v1
Expand All @@ -45,7 +40,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/kime.7z
asset_path: /tmp/kime/kime.7z
asset_name: kime-${{ steps.version.outputs.ver }}.7z
asset_content_type: application/x-7z-compressed

Expand All @@ -55,7 +50,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/kime_${{ steps.version.outputs.ver }}_amd64.deb
asset_path: /tmp/kime/kime_${{ steps.version.outputs.ver }}_amd64.deb
asset_name: kime_${{ steps.version.outputs.ver }}_amd64.deb
asset_content_type: application/x-xz

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1.0)

project(kime VERSION 0.8.1)
project(kime VERSION 0.9.0)

option(ENABLE_GTK2 "Enable GTK2 immodule" OFF)
option(ENABLE_GTK3 "Enable GTK3 immodule" OFF)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
FROM rust:slim

RUN apt-get update -y && apt-get install -y p7zip pkg-config libpango1.0-dev libcairo2-dev libgtk-3-dev libglib2.0 libxcb1
FROM riey/kime-build:0.1.0

WORKDIR /opt/kime

RUN mkdir -pv /opt/kime-out

COPY docs ./docs
COPY xtask ./xtask
COPY engine ./engine
COPY xim ./xim
COPY wayland ./wayland
COPY gtk2 ./gtk2
COPY gtk3 ./gtk3
COPY gtk4 ./gtk4
COPY qt5 ./qt5
COPY qt6 ./qt6

COPY Cargo.toml .
COPY Cargo.lock .

RUN mkdir .cargo
RUN cargo vendor > .cargo/config
RUN cargo install -f cargo-deb

COPY CMakeLists.txt .
COPY LICENSE .
COPY .cargo ./.cargo

COPY pkg ./pkg
# vendor cargo deps
RUN cargo vendor >> .cargo/config

CMD ./pkg/release-deb.sh
CMD cargo xtask build XIM WAYLAND GTK2 GTK3 GTK4 QT5 QT6 && 7z a /opt/kime-out/kime.7z ./build/out/* && cargo xtask release-deb /opt/kime-out
2 changes: 1 addition & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kime-xtask"
version = "0.8.0"
version = "0.9.0"
authors = ["Riey <[email protected]>"]
edition = "2018"

Expand Down

0 comments on commit b4483a8

Please sign in to comment.