Skip to content

Commit

Permalink
Merge pull request #121 from kachick/add-action-update-nixpkgs
Browse files Browse the repository at this point in the history
Add action to update flake.lock and related CI/.ruby-version dependencies
  • Loading branch information
kachick authored Sep 29, 2023
2 parents 51d2615 + 7523506 commit c4c16fb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 77 deletions.
1 change: 0 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

nix_direnv_watch_file .ruby-version
use flake
9 changes: 0 additions & 9 deletions .github/renovate.json

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ jobs:
- uses: actions/checkout@v4
- uses: dprint/check@v2.2
with:
# Keep same version as used in *.nix
dprint-version: '0.40.0'
dprint-version: '0.40.0' # selfup { "regex": "\\d[^']+", "script": "dprint --version | cut -d ' ' -f 2" }

typos:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Keep same version as used in *.nix
- uses: crate-ci/typos@v1.16.4
- uses: crate-ci/typos@v1.16.4 # selfup { "regex": "\\d\\.\\d+\\.\\d+", "script": "typos --version | cut -d ' ' -f 2" }
with:
files: |
.
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/update-nixpkgs-and-versions-in-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update nixpkgs and CI dependencies
on:
pull_request:
paths:
- '.github/workflows/update-nixpkgs-and-versions-in-ci.yml'
schedule:
# Every Monday 10:17 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '17 1 * * 1'
workflow_dispatch:

jobs:
update-nixpkgs:
uses: kachick/anylang-template/.github/workflows/reusable-update-nixpkgs-and-versions-in-ci.yml@2413fce002263e6675ce084da251be0dbbe2a8fc
if: (github.event.sender.login == 'kachick') || (github.event_name != 'pull_request')
with:
dry-run: ${{ github.event_name == 'pull_request' }}
optional-run: |
ruby -e 'puts RUBY_VERSION' > .ruby-version
git diff-index --quiet HEAD || git commit -m 'Update .ruby-version' .ruby-version
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
56 changes: 1 addition & 55 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
# How to update the revision
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-ruby.url = "github:bobvanderlinden/nixpkgs-ruby";
nixpkgs-ruby.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, nixpkgs-ruby, flake-utils }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ruby = nixpkgs-ruby.lib.packageFromRubyVersionFile {
file = ./.ruby-version;
inherit system;
};
in
{
devShells.default = with pkgs;
Expand All @@ -28,7 +22,7 @@
# https://github.com/kachick/dotfiles/pull/228
bashInteractive

ruby
ruby_3_2
# Required to build psych via irb dependency
# https://github.com/kachick/irb-power_assert/issues/116
# https://github.com/ruby/irb/pull/648
Expand Down

0 comments on commit c4c16fb

Please sign in to comment.