Skip to content

Commit 01638a1

Browse files
authored
Rollback to GHA (Riey#184)
1 parent 15be317 commit 01638a1

File tree

7 files changed

+128
-97
lines changed

7 files changed

+128
-97
lines changed

.circleci/config.yml

-97
This file was deleted.

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/build

.github/workflows/ci.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
- 'releases/*'
8+
pull_request:
9+
branches:
10+
- 'develop'
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-20.04
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: actions/cache@v2
22+
with:
23+
path: |
24+
~/.cargo/registry
25+
~/.cargo/git
26+
target
27+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
28+
- name: Update apt
29+
run: sudo apt-get update -y
30+
- name: Install packages
31+
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 libappindicator3-dev
32+
- name: Build
33+
run: cargo xtask build --mode Debug XIM GTK2 GTK3 QT5
34+
- name: Run tests
35+
run: cargo xtask test
36+
37+
markdown-lint:
38+
runs-on: ubuntu-20.04
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
- run: sudo npm install -g markdownlint-cli
43+
- run: sudo npm install -g markdown-link-check
44+
- run: ci/check_md.sh
45+
46+
format:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Check Rustfmt
52+
run: cargo fmt -- --check

.github/workflows/release.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
packaging:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set VER
15+
id: version
16+
run: echo "::set-output name=ver::$(grep '^version =' xtask/Cargo.toml|head -n1|cut -d\" -f2)"
17+
- name: Make temp dir
18+
run: mkdir /tmp/kime
19+
- name: Build image
20+
run: docker build --tag riey/kime --network=host .
21+
- name: Run image
22+
run: docker run -e "TERM=xterm-256color" -e "CARGO_TERM_COLOR=always" --network=host -v /tmp/kime:/opt/kime-out riey/kime release
23+
- name: Create draft release
24+
id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: Release ${{ github.ref }}
31+
draft: true
32+
prerelease: false
33+
34+
- name: Upload archive
35+
uses: actions/upload-release-asset@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
upload_url: ${{ steps.create_release.outputs.upload_url }}
40+
asset_path: /tmp/kime/kime.7z
41+
asset_name: kime-${{ steps.version.outputs.ver }}.7z
42+
asset_content_type: application/x-7z-compressed
43+
44+
- name: Upload deb package
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: /tmp/kime/kime_${{ steps.version.outputs.ver }}_amd64.deb
51+
asset_name: kime_${{ steps.version.outputs.ver }}_amd64.deb
52+
asset_content_type: application/x-xz

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM riey/kime-build:latest
2+
3+
WORKDIR /opt/kime
4+
5+
RUN mkdir -pv /opt/kime-out
6+
7+
COPY ci ./ci
8+
COPY docs ./docs
9+
COPY res ./res
10+
COPY src ./src
11+
12+
COPY Cargo.toml .
13+
COPY Cargo.lock .
14+
COPY LICENSE .
15+
COPY .cargo ./.cargo
16+
17+
ENTRYPOINT [ "ci/build_release.sh" ]

ci/build_release.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
cargo xtask build XIM WAYLAND GTK2 GTK3 GTK4 QT5 QT6
4+
7z a /opt/kime-out/kime.7z ./build/out/*
5+
cargo xtask release-deb /opt/kime-out
File renamed without changes.

0 commit comments

Comments
 (0)