Skip to content

Commit 183ca1c

Browse files
committed
feat(ci): refactor ci auto commit
1 parent 6aea9c6 commit 183ca1c

File tree

3 files changed

+114
-97
lines changed

3 files changed

+114
-97
lines changed

.github/workflows/build.yml

-51
This file was deleted.

.github/workflows/ci.yml

+114-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, dev]
65
pull_request:
7-
branches: [main, dev]
86

97
jobs:
108
lint:
@@ -16,3 +14,117 @@ jobs:
1614
with:
1715
token: ${{ secrets.GITHUB_TOKEN }}
1816
args: lua
17+
docs:
18+
runs-on: ubuntu-latest
19+
if: ${{ github.ref == 'refs/heads/main' }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: panvimdoc
23+
uses: kdheepak/panvimdoc@main
24+
with:
25+
vimdoc: zenbones
26+
pandoc: doc/zenbones.md
27+
description: "A collection of contrast-based vim/neovim colorschemes"
28+
version: "Vim 8.1 / Nvim v0.8.0"
29+
treesitter: true
30+
- name: Push changes
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: "chore(build): auto-generate vimdoc"
34+
commit_user_name: "github-actions[bot]"
35+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
36+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
37+
build:
38+
runs-on: ubuntu-latest
39+
if: ${{ github.ref == 'refs/heads/main' }}
40+
steps:
41+
- uses: actions/checkout@v3
42+
43+
- name: Clone lush
44+
run: |
45+
git clone --depth 1 https://github.com/rktjmp/lush.nvim ~/.local/share/nvim/site/pack/zenbones/start/lush.nvim
46+
git clone --depth 1 https://github.com/rktjmp/shipwright.nvim ~/.local/share/nvim/site/pack/zenbones/start/shipwright.nvim
47+
48+
- uses: rhysd/action-setup-vim@v1
49+
with:
50+
neovim: true
51+
version: stable
52+
53+
- name: Setup git
54+
run: |
55+
printf 'BUILD_BRANCH=bot/build/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
56+
57+
- name: Checkout to build branch
58+
run: git checkout -b ${BUILD_BRANCH}
59+
60+
- name: Run builder script
61+
run: |
62+
mkdir -p autoload/lightline/colorscheme colors/ lua/lualine extras
63+
make
64+
65+
- name: Push changes
66+
uses: stefanzweifel/git-auto-commit-action@v4
67+
with:
68+
commit_message: "chore(build): rebuild artifacts"
69+
commit_user_name: "github-actions[bot]"
70+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
71+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
72+
73+
format:
74+
runs-on: ubuntu-latest
75+
if: ${{ github.ref == 'refs/heads/main' }}
76+
steps:
77+
- uses: actions/checkout@v3
78+
79+
- name: Setup git
80+
run: |
81+
printf 'STYLE_BRANCH=bot/style/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
82+
83+
- name: Checkout to style branch
84+
run: git checkout -b ${STYLE_BRANCH}
85+
86+
- uses: JohnnyMorganz/stylua-action@v2
87+
with:
88+
version: latest
89+
token: ${{ secrets.GITHUB_TOKEN }}
90+
args: --config-path=.stylua.toml lua/
91+
92+
- uses: actions/setup-node@v3
93+
- name: Apply prettier
94+
run: |
95+
npm install -g prettier
96+
prettier --write **/*.md
97+
98+
- name: Push changes
99+
uses: stefanzweifel/git-auto-commit-action@v4
100+
with:
101+
commit_message: "chore(build): format"
102+
commit_user_name: "github-actions[bot]"
103+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
104+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
105+
106+
release:
107+
name: release
108+
if: ${{ github.ref == 'refs/heads/main' }}
109+
needs:
110+
- docs
111+
- build
112+
- format
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: google-github-actions/release-please-action@v3
116+
id: release
117+
with:
118+
release-type: simple
119+
package-name: zenbones.nvim
120+
- uses: actions/checkout@v3
121+
- name: tag stable versions
122+
if: ${{ steps.release.outputs.release_created }}
123+
run: |
124+
git config user.name github-actions[bot]
125+
git config user.email github-actions[bot]@users.noreply.github.com
126+
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
127+
git tag -d stable || true
128+
git push origin :stable || true
129+
git tag -a stable -m "Last Stable Release"
130+
git push origin stable

.github/workflows/doc.yml

-44
This file was deleted.

0 commit comments

Comments
 (0)