-
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (48 loc) · 1.53 KB
/
generate-lua.yml
File metadata and controls
60 lines (48 loc) · 1.53 KB
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
name: Generate Lua files
on:
workflow_dispatch:
jobs:
gen-lua:
env:
PALETTE_COMMIT: df35c12c2fc6d2f7a68315a71fe85327199b883c
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Setup Lua
uses: leafo/gh-actions-lua@v10
- name: Setup Luarocks
uses: leafo/gh-actions-luarocks@v4
- name: Install deps
run:
luarocks install lua-cjson
- name: Generate Lua files
id: gen-lua
run: |
curl -Lo palette-porcelain.json \
"https://github.com/catppuccin/palette/raw/$PALETTE_COMMIT/palette-porcelain.json"
lua scripts/gen.lua
- name: Push changes
id: changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "feat: regen .lua" || true
git push || true
- uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
- name: Create tag
env:
LATEST_TAG: ${{ steps.latest-tag.outputs.tag }}
run: |
raw="${LATEST_TAG#v}"
ver="${raw%-*}"
rev="${raw#*-}"
(( rev = rev + 1 ))
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]"
git tag "v$ver-$rev"
git push origin "v$ver-$rev"