Skip to content

Commit

Permalink
ci: merge and cleanup workflows (#282)
Browse files Browse the repository at this point in the history
* ci: only format nix files in upstream repo

* ci: merge release & publish workflows

* ci: merge flake.lock & port update workflows

* ci: conditionally run website workflow
  • Loading branch information
getchoo authored Jul 8, 2024
1 parent e323548 commit d75d580
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
format:
name: Format Nix files

if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: github.repository_owner == 'Catppuccin' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'

runs-on: ubuntu-latest

Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/publish.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,53 @@ on:
jobs:
release-please:
name: Make release

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

outputs:
release_created: ${{ steps.release-please-run.outputs.release_created }}
tag_name: ${{ steps.release-please-run.outputs.tag_name }}

steps:
- uses: googleapis/release-please-action@v4
id: release-please-run
with:
release-type: simple
package-name: catppuccin/nix

publish:
name: Publish to Flake registries
if: ${{ needs.release-please.outputs.release_created }}
needs: release-please

runs-on: ubuntu-latest

env:
TAG_NAME: ${{ needs.release-please.outputs.tag_name }}

permissions:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ env.TAG_NAME }}

- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Publish on Flakestry
uses: flakestry/flakestry-publish@main
with:
version: ${{ env.TAG_NAME }}

- name: Push to FlakeHub
uses: DeterminateSystems/flakehub-push@v4
with:
tag: ${{ env.TAG_NAME }}
visibility: "public"
31 changes: 0 additions & 31 deletions .github/workflows/update-flake.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/update-locks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update lockfiles

on:
schedule:
# run every friday
- cron: "0 0 * * 5"
workflow_dispatch:

jobs:
flake:
name: Update flake.lock

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@V27

- uses: DeterminateSystems/update-flake-lock@v23
with:
path-to-flake-dir: "./dev"
commit-msg: "chore: update dev flake inputs"
pr-title: "chore: update dev flake inputs"
token: ${{ github.token }}

ports:
name: Update port sources

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@V27

- name: Install npins
run: nix profile install 'nixpkgs#npins'

- uses: getchoo/[email protected]
with:
npins-directory: "./.sources"
commit-message: "chore(modules): update ports"
pr-title: "chore(modules): update ports"
token: ${{ github.token }}
34 changes: 0 additions & 34 deletions .github/workflows/update-ports.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ name: Build & deploy website
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'CHANGELOG.md'
- '**.lock'
- '**.nix'
pull_request:
paths:
- 'docs/**'
- 'CHANGELOG.md'
- '**.lock'
- '**.nix'
workflow_dispatch:

jobs:
Expand Down

0 comments on commit d75d580

Please sign in to comment.