ci: clean up and simplify workflows (#1541)

This commit is contained in:
uncenter authored and GitHub committed 2024-12-29 11:02:44 -05:00
1 parent 21bec677c8
commit 2c4eefa877
10 files changed
+43 -59

No files matched your search

@@ -1,34 +1,15 @@
name: Lint & Build
name: Build Stylus Export
on:
workflow_dispatch:
pull_request:
paths-ignore: ["docs/**"]
push:
branches: [main]
paths-ignore: ["docs/**"]
jobs:
lint:
name: Lint Userstyles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: nekowinston/setup-deno@main
with:
deno-version: v2.1.3
- name: Run Lint
run: deno task lint
build:
name: Generate Stylus Export
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
needs: lint
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
@@ -38,17 +19,16 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.USERSTYLES_TOKEN }}
ref: ${{ github.ref }}
- name: Setup Deno
uses: nekowinston/setup-deno@main
with:
deno-version: v2.1.3
- name: Generate Stylus import file
- name: Generate Stylus import
run: deno task stylus-import
- name: Upload Release Artifacts
- name: Upload release artifact
run: gh release upload --clobber all-userstyles-export ./dist/import.json
env:
GH_TOKEN: ${{ github.token }}
+1 -13
View File
@@ -1,13 +1,9 @@
name: CI
on:
workflow_dispatch:
push:
branches: [main]
env:
HAS_USERSTYLES_TOKEN: ${{ secrets.USERSTYLES_TOKEN != '' }}
jobs:
ci:
runs-on: ubuntu-latest
@@ -17,18 +13,11 @@ jobs:
contents: write
# Prevent infinite loops by checking if the last commit was autogenerated.
if: ${{ github.event.commits[0].author.name != 'github-actions' }}
if: ${{ github.repository == 'catppuccin/userstyles' && github.event.commits[0].author.name != 'github-actions' }}
steps:
- uses: actions/checkout@v4
if: env.HAS_USERSTYLES_TOKEN
with:
token: ${{ secrets.USERSTYLES_TOKEN }}
ref: ${{ github.ref }}
fetch-depth: 2
- uses: actions/checkout@v4
if: env.HAS_USERSTYLES_TOKEN == 'false'
with:
ref: ${{ github.ref }}
fetch-depth: 2
- name: Setup Deno
@@ -68,5 +57,4 @@ jobs:
push: false
- name: Push changes
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' && env.HAS_USERSTYLES_TOKEN }}
run: git push origin "HEAD:${{ github.ref }}" --atomic
+2 -2
View File
@@ -9,8 +9,8 @@ on:
paths: ["**/*.ts"]
jobs:
deno-check:
name: Check Deno code
check:
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
steps:
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
- name: Regenerate Deno lock
run: deno cache **/*.ts --lock=deno.lock
- name: Commit & Push
- name: Commit & push changes
uses: EndBug/add-and-commit@v9
with:
message: "chore: regenerate `deno.lock`"
-1
View File
@@ -7,7 +7,6 @@ on:
jobs:
triage:
name: Add labels
runs-on: ubuntu-latest
steps:
+25
View File
@@ -0,0 +1,25 @@
name: Lint Userstyles
on:
workflow_dispatch:
pull_request:
paths-ignore: ["docs/**"]
push:
branches: [main]
paths-ignore: ["docs/**"]
jobs:
lint:
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: nekowinston/setup-deno@main
with:
deno-version: v2.1.3
- name: Lint
run: deno task lint
+3 -6
View File
@@ -3,18 +3,16 @@ name: Sync Maintainers
on:
workflow_dispatch:
push:
paths:
- "scripts/userstyles.yml"
branches: [main]
paths: ["scripts/userstyles.yml"]
jobs:
sync-maintainers:
name: Sync maintainers
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Deno
uses: nekowinston/setup-deno@main
@@ -22,7 +20,6 @@ jobs:
deno-version: v2.1.3
- name: Sync maintainers
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
run: deno task sync-maintainers
env:
GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }}
+1 -3
View File
@@ -5,9 +5,8 @@ on:
jobs:
triage:
name: Add labels
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, '(tree-wide)') }}
if: ${{ !contains(github.event.pull_request.title, '(tree-wide)') || !contains(github.event.pull_request.title, '(treewide)') }}
steps:
- uses: actions/checkout@v4
@@ -19,4 +18,3 @@ jobs:
sync-labels: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
+3 -5
View File
@@ -4,17 +4,15 @@ on:
workflow_dispatch:
push:
branches: [main]
paths:
- ".github/labels.yml"
paths: [".github/labels.yml"]
jobs:
update:
name: Sync labels
sync:
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
steps:
- name: Sync labels
uses: r7kamura/github-label-sync-action@v0
if: ${{ github.repository == 'catppuccin/userstyles' }}
with:
allow_added_labels: "true"
+3 -4
View File
@@ -3,19 +3,18 @@ name: Deploy Website
on:
workflow_dispatch:
push:
branches: ["main"]
branches: [main]
paths: ["scripts/userstyles.yml"]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository == 'catppuccin/userstyles'
runs-on: ubuntu-latest
environment: website
name: Vercel Deploy
steps:
- name: Deploy via cURL
shell: bash
env:
DEPLOY_HOOK: ${{ secrets.VERCEL_DEPLOY_HOOK }}
run: curl -X POST "$DEPLOY_HOOK"
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json