Skip to content

Commit

Permalink
ci: automatically update xivlauncher-rb
Browse files Browse the repository at this point in the history
  • Loading branch information
drakon64 committed Jul 26, 2024
1 parent 2face84 commit da8b5c0
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
push:
branches:
- main
paths:
- "**.nix"
- flake.lock
- .github/workflows/*.yml
pull_request:
branches:
- main
paths:
- "**.nix"
- flake.lock
- .github/workflows/*.yml
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v12

- run: nix build
2 changes: 1 addition & 1 deletion .github/workflows/flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- flake.nix
schedule:
- cron: '0 12 * * *'
- cron: '0 11 * * *'
workflow_dispatch:

jobs:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/xivlauncher-rb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update

on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:

jobs:
update:
name: XIVLauncher-RB Update
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v13

- run: nix run github:Mic92/nix-update -- xivlauncher-rb --flake --commit --version-regex 'rb-v(.*)'

- id: create-pr
uses: peter-evans/create-pull-request@v6
with:
branch: update_xivlauncher-rb
delete-branch: true
committer: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
commit-message: 'pkgs: update xivlauncher-rb'
title: 'pkgs: update xivlauncher-rb'
labels: 'dependencies'
body: |
Automated bump of XIVLauncher-RB
- uses: benc-uk/workflow-dispatch@v1
if: ${{ contains(fromJSON('["created", "updated"]'), steps.create-pr.outputs.pull-request-operation) }}
with:
workflow: build.yml
ref: refs/heads/update_xivlauncher-rb
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
legacyPackages = forAllSystems (system: import ./default.nix {
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
});

packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system});

defaultPackage = forAllSystems (system: self.packages.${system}.xivlauncher-rb);
};
}

0 comments on commit da8b5c0

Please sign in to comment.