-
Notifications
You must be signed in to change notification settings - Fork 46
82 lines (76 loc) · 2.59 KB
/
main.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
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
style:
name: Run StyLua
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout LLS-Addons
# Use custom action to get submodules
# This allows us to get submodules that live on GitLab
- uses: dsaltares/fetch-gh-release-asset@1.1.0
name: Get submodule fetching action
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: carsakiller/get-submodules-action
file: dist.zip
target: submodule-action.zip
- name: Unzip submodule fetching action
run: unzip submodule-action.zip -d submodule-action
- uses: ./submodule-action/dist
name: Get all submodules
- uses: JohnnyMorganz/stylua-action@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check addons
build:
name: Get Addon Metadata
runs-on: ubuntu-latest
needs: style
if: ${{ github.event_name == 'push'}}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
name: Checkout LLS-Addons
# Use custom action to get submodules
# This allows us to get submodules that live on GitLab
- uses: dsaltares/fetch-gh-release-asset@1.1.0
name: Get submodule fetching action
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: carsakiller/get-submodules-action
file: dist.zip
target: submodule-action.zip
- name: Unzip submodule fetching action
run: unzip submodule-action.zip -d submodule-action
- uses: ./submodule-action/dist
name: Get all submodules
# Custom action that gets metadata on each addon
- uses: dsaltares/fetch-gh-release-asset@1.1.0
name: Get submodule metadata fetching action
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: LuaLS/LLS-Addons-Action
file: dist.zip
target: action.zip
- name: Unzip custom action
run: unzip action.zip -d action
- uses: ./action/dist
name: Get Addon Metadata
# Commit new metadata
- name: Commit Metadata
uses: stefanzweifel/git-auto-commit-action@v4.16.0
with:
commit_message: "chore: Update Addon Metadata"
file_pattern: addons/*/info.json
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com