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