-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (135 loc) · 5.04 KB
/
package.yaml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# description of this workflow, can be anything you want
name: Package and release 📦
# we need to let GitHub know _when_ we want to release, typically only when we create a new tag.
# this will target only tags, and not all pushes to the master branch.
# this part can be heavily customized to your liking, like targeting only tags that match a certain word,
# other branches or even pullrequests.
on:
workflow_dispatch:
push:
tags:
- "**"
jobs:
prepare:
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
steps:
# we first have to clone the AddOn project, this is a required step
- name: 👱 Clone project
uses: actions/checkout@v3
with:
fetch-depth: 0 # gets entire git history, needed for automatic changelogs
path: ./variant
- name: 🎭 Get Zottelchen/adibags-creator-action
uses: actions/checkout@v3
with:
repository: Zottelchen/adibags-creator-action
ref: refs/heads/v2
persist-credentials: false
path: ./action
- name: 🏹 Merge
run: |
cp -r ./variant/* ./action
mkdir ./dist
cp ./variant/.pkgmeta ./dist/.pkgmeta
mv ./action/* .
cp -r ./variant/.git .
rm -rf ./action ./variant
ls -la .
- name: 🗄️ Store artifact
uses: actions/upload-artifact@v3
with:
name: pre-build
path: ./
build:
needs: prepare
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
steps:
- name: 🗄️ Retrieve artifact
uses: actions/download-artifact@v3
with:
name: pre-build
path: ./
- name: 🔐 Adjust permissions
run: chmod +x ./entrypoint.sh
- name: 📷 Build AdiBags Extension
uses: ./
env:
PYTHONUNBUFFERED: 1
BLIZZARD_API_ID: ${{ secrets.BLIZZ_ID }}
BLIZZARD_API_SECRET: ${{ secrets.BLIZZ_SECRET }}
- name: 😎 Stylua
uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
# CLI arguments
args: --verify --indent-type spaces --indent-width 2 --line-endings Windows --quote-style AutoPreferDouble out/AdiBags_HolidayItems.lua out/Localization.lua
- name: 🗄️ Store artifact
uses: actions/upload-artifact@v3
with:
name: pre-lint
path: ./
lint:
needs: build
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
steps:
- name: 🗄️ Retrieve artifact
uses: actions/download-artifact@v3
with:
name: pre-lint
path: ./
- name: ✅ Luacheck Main Addon
uses: lunarmodules/luacheck@v0
with:
args: out/AdiBags_HolidayItems.lua --ignore 113 211 212 611 614 631
# ignored (see https://luacheck.readthedocs.io/en/stable/warnings.html):
# 113: Accessing an undefined global variable. - There are bound to be some as this an addon, as there are some functions which are known to WoW only.
# 211: Unused local variable. - Not important.
# 212: Unused argument. - Not important.
# 611: A line consists of nothing but whitespace. - Oh no! Oh wait, not important.
# 614: Trailing whitespace in a comment. - These reports are just plain wrong.
# 631: Line is too long. - Not important.
- name: ☑️ Luacheck Localization
uses: lunarmodules/luacheck@v0
with:
args: out/Localization.lua --ignore 113 211 212 542 611 614 631
# additionally ignored:
# 542: empty if branch - This is expected, since Bigwigs will replace the empty branch AFTER this check runs.
- name: 🗄️ Store artifact
uses: actions/upload-artifact@v3
with:
name: pre-release
path: ./
release:
needs: lint
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
steps:
- name: 🗄️ Retrieve artifact
uses: actions/download-artifact@v3
with:
name: pre-release
path: ./
- name: 📝 Copy Output
run: |
cp -r ./out/* ./dist
cp -r ./out/.git ./dist
ls -la ./dist
cd ./dist
git add *
# once cloned, we just run the GitHub Action for the packager project
- name: 📦 Package and release
uses: BigWigsMods/packager@v2
with:
args: -t dist