-
Notifications
You must be signed in to change notification settings - Fork 21
117 lines (106 loc) · 3 KB
/
unko.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: test
on:
push:
branches:
- oshiri
paths-ignore:
- 'LICENSE'
- 'README.*'
- 'doc/*'
- 'img/*'
- 'pkg/*'
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.*'
- 'doc/*'
- 'img/*'
- 'pkg/*'
env:
APP_NAME: super_unko
DOCKER_BUILDKIT: 1
jobs:
skip:
runs-on: ubuntu-latest
steps:
- run: echo "Skip job"
before:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "no [skip ci]"
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [default, "3.2", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0"]
needs: before
steps:
- uses: actions/checkout@v2
# FIXME: #95
# - uses: satackey/[email protected]
# with:
# key: docker-image-cache-${{ matrix.version }}-{hash}
# restore-keys: |
# docker-image-cache-${{ matrix.version }}-
- name: Test
run: docker-compose -f docker-compose-ci.yml run ci_sh_${{ matrix.version }}
format:
runs-on: ubuntu-latest
needs: before
steps:
- uses: actions/checkout@v2
- name: Run format
run: ./linter.sh format
lint:
runs-on: ubuntu-latest
needs: before
steps:
- uses: actions/checkout@v2
- name: Run lint
run: ./linter.sh lint
update-repository:
runs-on: ubuntu-latest
needs: [test, format, lint]
if: github.ref == 'refs/heads/oshiri'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# deb, rpmファイルの生成
- name: Set latest tag version to output
id: vars
run: echo ::set-output name=tag::$(git tag -l '*.*.*' | sort -V | tail -n 1)
- name: Set tag version to .tar2package.yml
run: sed -i 's:\$VERSION:${{ steps.vars.outputs.tag }}:g' .tar2package.yml
- name: Print .tar2package.yml
run: cat .tar2package.yml
- name: Generate packages
run: ./package.sh
- name: Git commit packages
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add pkg/*
git commit -m ":arrow_up: [CI] update pkg/${{ env.APP_NAME }}.deb and pkg/${{ env.APP_NAME }}.rpm"
# READMEに目次を埋め込む
- name: Install gh-md-toc
run: |
wget https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc
chmod +x gh-md-toc
- name: Insert TOC
run: |
./gh-md-toc --insert *.md doc/*.md
rm *.md.orig.*
rm *.md.toc.*
rm doc/*.md.orig.*
rm doc/*.md.toc.*
- name: Git commit documents
run: |
git add *.md doc/*.md
git commit -m ":memo: [CI] update TOC"
- name: Git push
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: oshiri