-
-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (107 loc) · 3.26 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
commits:
name: Commits
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: mrcjkb/lua-typecheck-action@v0
with:
directories: lua
configpath: ".luarc.json"
selene:
name: Selene
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- name: Selene
run: |
cargo binstall --no-confirm selene
selene --config selene.toml ./lua
code_format:
name: Code Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --config-path .stylua.toml ./lua
- name: Auto commit
if: ${{ github.ref != 'refs/heads/main' }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(pr): auto-commit"
ubuntu_installer:
name: Ubuntu Installer
runs-on: ubuntu-latest
steps:
- name: Get branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install lin.nvim
run: |
set -x
echo '${{ steps.extract_branch.outputs.branch }}'
export BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}
git clone --single-branch --branch $BRANCH_NAME --depth=1 https://github.com/linrongbin16/lin.nvim ~/.nvim && cd ~/.nvim && bash -euxo pipefail ./install
macos_installer:
name: MacOS Installer
runs-on: macos-latest
steps:
- uses: Homebrew/actions/setup-homebrew@master
- name: Get branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install lin.nvim
shell: bash
run: |
set -x
echo '${{ steps.extract_branch.outputs.branch }}'
echo ${{ steps.extract_branch.outputs.branch }}
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
git clone --single-branch --branch ${{ steps.extract_branch.outputs.branch }} --depth=1 https://github.com/linrongbin16/lin.nvim ~/.nvim && cd ~/.nvim && bash -euxo pipefail ./install
release:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- typecheck
- selene
- code_format
- ubuntu_installer
- macos_installer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: simple
package-name: lin.nvim