Skip to content

Commit 2c4eefa

Browse files
authored
ci: clean up and simplify workflows (catppuccin#1541)
1 parent 21bec67 commit 2c4eefa

10 files changed

Lines changed: 43 additions & 59 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
1-
name: Lint & Build
1+
name: Build Stylus Export
22

33
on:
44
workflow_dispatch:
5-
pull_request:
6-
paths-ignore: ["docs/**"]
75
push:
86
branches: [main]
97
paths-ignore: ["docs/**"]
108

119
jobs:
12-
lint:
13-
name: Lint Userstyles
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Setup Deno
20-
uses: nekowinston/setup-deno@main
21-
with:
22-
deno-version: v2.1.3
23-
24-
- name: Run Lint
25-
run: deno task lint
26-
2710
build:
28-
name: Generate Stylus Export
11+
if: github.repository == 'catppuccin/userstyles'
2912
runs-on: ubuntu-latest
30-
needs: lint
31-
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
3213
permissions:
3314
# Give the default GITHUB_TOKEN write permission to commit and push the
3415
# added or changed files to the repository.
@@ -38,17 +19,16 @@ jobs:
3819
- uses: actions/checkout@v4
3920
with:
4021
token: ${{ secrets.USERSTYLES_TOKEN }}
41-
ref: ${{ github.ref }}
4222

4323
- name: Setup Deno
4424
uses: nekowinston/setup-deno@main
4525
with:
4626
deno-version: v2.1.3
4727

48-
- name: Generate Stylus import file
28+
- name: Generate Stylus import
4929
run: deno task stylus-import
5030

51-
- name: Upload Release Artifacts
31+
- name: Upload release artifact
5232
run: gh release upload --clobber all-userstyles-export ./dist/import.json
5333
env:
5434
GH_TOKEN: ${{ github.token }}

.github/workflows/ci.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
name: CI
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches: [main]
76

8-
env:
9-
HAS_USERSTYLES_TOKEN: ${{ secrets.USERSTYLES_TOKEN != '' }}
10-
117
jobs:
128
ci:
139
runs-on: ubuntu-latest
@@ -17,18 +13,11 @@ jobs:
1713
contents: write
1814

1915
# Prevent infinite loops by checking if the last commit was autogenerated.
20-
if: ${{ github.event.commits[0].author.name != 'github-actions' }}
16+
if: ${{ github.repository == 'catppuccin/userstyles' && github.event.commits[0].author.name != 'github-actions' }}
2117
steps:
2218
- uses: actions/checkout@v4
23-
if: env.HAS_USERSTYLES_TOKEN
2419
with:
2520
token: ${{ secrets.USERSTYLES_TOKEN }}
26-
ref: ${{ github.ref }}
27-
fetch-depth: 2
28-
- uses: actions/checkout@v4
29-
if: env.HAS_USERSTYLES_TOKEN == 'false'
30-
with:
31-
ref: ${{ github.ref }}
3221
fetch-depth: 2
3322

3423
- name: Setup Deno
@@ -68,5 +57,4 @@ jobs:
6857
push: false
6958

7059
- name: Push changes
71-
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' && env.HAS_USERSTYLES_TOKEN }}
7260
run: git push origin "HEAD:${{ github.ref }}" --atomic

.github/workflows/deno-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
paths: ["**/*.ts"]
1010

1111
jobs:
12-
deno-check:
13-
name: Check Deno code
12+
check:
13+
if: github.repository == 'catppuccin/userstyles'
1414
runs-on: ubuntu-latest
1515

1616
steps:

.github/workflows/deno-lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Regenerate Deno lock
2424
run: deno cache **/*.ts --lock=deno.lock
2525

26-
- name: Commit & Push
26+
- name: Commit & push changes
2727
uses: EndBug/add-and-commit@v9
2828
with:
2929
message: "chore: regenerate `deno.lock`"

.github/workflows/issues.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
jobs:
99
triage:
10-
name: Add labels
1110
runs-on: ubuntu-latest
1211

1312
steps:

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint Userstyles
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths-ignore: ["docs/**"]
7+
push:
8+
branches: [main]
9+
paths-ignore: ["docs/**"]
10+
11+
jobs:
12+
lint:
13+
if: github.repository == 'catppuccin/userstyles'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Deno
20+
uses: nekowinston/setup-deno@main
21+
with:
22+
deno-version: v2.1.3
23+
24+
- name: Lint
25+
run: deno task lint

.github/workflows/maintainers.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,23 @@ name: Sync Maintainers
33
on:
44
workflow_dispatch:
55
push:
6-
paths:
7-
- "scripts/userstyles.yml"
6+
branches: [main]
7+
paths: ["scripts/userstyles.yml"]
88

99
jobs:
1010
sync-maintainers:
11-
name: Sync maintainers
11+
if: github.repository == 'catppuccin/userstyles'
1212
runs-on: ubuntu-latest
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
with:
17-
ref: ${{ github.ref }}
1816

1917
- name: Setup Deno
2018
uses: nekowinston/setup-deno@main
2119
with:
2220
deno-version: v2.1.3
2321

2422
- name: Sync maintainers
25-
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
2623
run: deno task sync-maintainers
2724
env:
2825
GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }}

.github/workflows/pull-requests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ on:
55

66
jobs:
77
triage:
8-
name: Add labels
98
runs-on: ubuntu-latest
10-
if: ${{ !contains(github.event.pull_request.title, '(tree-wide)') }}
9+
if: ${{ !contains(github.event.pull_request.title, '(tree-wide)') || !contains(github.event.pull_request.title, '(treewide)') }}
1110

1211
steps:
1312
- uses: actions/checkout@v4
@@ -19,4 +18,3 @@ jobs:
1918
sync-labels: true
2019
env:
2120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

.github/workflows/sync-labels.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ on:
44
workflow_dispatch:
55
push:
66
branches: [main]
7-
paths:
8-
- ".github/labels.yml"
7+
paths: [".github/labels.yml"]
98

109
jobs:
11-
update:
12-
name: Sync labels
10+
sync:
11+
if: github.repository == 'catppuccin/userstyles'
1312
runs-on: ubuntu-latest
1413

1514
steps:
1615
- name: Sync labels
1716
uses: r7kamura/github-label-sync-action@v0
18-
if: ${{ github.repository == 'catppuccin/userstyles' }}
1917
with:
2018
allow_added_labels: "true"

.github/workflows/website.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@ name: Deploy Website
33
on:
44
workflow_dispatch:
55
push:
6-
branches: ["main"]
6+
branches: [main]
77
paths: ["scripts/userstyles.yml"]
88

99
jobs:
1010
deploy:
11-
runs-on: ubuntu-latest
1211
if: github.repository == 'catppuccin/userstyles'
12+
runs-on: ubuntu-latest
13+
1314
environment: website
14-
name: Vercel Deploy
1515
steps:
1616
- name: Deploy via cURL
1717
shell: bash
1818
env:
1919
DEPLOY_HOOK: ${{ secrets.VERCEL_DEPLOY_HOOK }}
2020
run: curl -X POST "$DEPLOY_HOOK"
21-
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

0 commit comments

Comments
 (0)