From da8b5c029b47bd21a02dbf2f13c0410d63f3928f Mon Sep 17 00:00:00 2001 From: Adam Chance <6444703+drakon64@users.noreply.github.com> Date: Sat, 27 Jul 2024 00:14:33 +0100 Subject: [PATCH] ci: automatically update xivlauncher-rb --- .github/workflows/build.yml | 30 +++++++++++++++++++++ .github/workflows/flake.yml | 2 +- .github/workflows/xivlauncher-rb.yml | 39 ++++++++++++++++++++++++++++ flake.nix | 3 +++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/xivlauncher-rb.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3413295 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml index a3bb62b..9b76b64 100644 --- a/.github/workflows/flake.yml +++ b/.github/workflows/flake.yml @@ -7,7 +7,7 @@ on: paths: - flake.nix schedule: - - cron: '0 12 * * *' + - cron: '0 11 * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/xivlauncher-rb.yml b/.github/workflows/xivlauncher-rb.yml new file mode 100644 index 0000000..8480e20 --- /dev/null +++ b/.github/workflows/xivlauncher-rb.yml @@ -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] ' + author: 'github-actions[bot] ' + 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 diff --git a/flake.nix b/flake.nix index cf6498e..9cdd42f 100644 --- a/flake.nix +++ b/flake.nix @@ -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); }; }