From f0cdd0bf08f4e17629ba38f2cd49aabb7fa0e8ec Mon Sep 17 00:00:00 2001 From: James Curtin Date: Thu, 7 Sep 2023 22:42:42 -0400 Subject: [PATCH] Update bootstrap SHA --- .github/workflows/lint.yaml | 9 +++++++++ README.md | 20 ++++++++++++++++++-- test.sh => bin/test | 0 bin/update-bootstrap-sha | 5 +++++ bootstrap/macos.sh | 1 + homebrew/Brewfile.base | 3 +++ 6 files changed, 36 insertions(+), 2 deletions(-) rename test.sh => bin/test (100%) create mode 100755 bin/update-bootstrap-sha diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a9bfb8e..79a4ba0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -38,3 +38,12 @@ jobs: run: GO111MODULE=on go install mvdan.cc/sh/v3/cmd/shfmt@latest - name: Check formatting run: shfmt -f . | grep -v meta/dotbot | xargs shfmt -s -d + correct-sha256: + name: SHA256 in README is correct + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Update SHA script + run: bin/update-bootstrap-sha + - name: Check that there is no diff + run: git diff --exit-code diff --git a/README.md b/README.md index d7e7e03..44890b8 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,24 @@ $ cd ~/repos/dotfiles ./install-profile mac ``` -## Testing +## Developing and Testing +If you update the `bootstrap/bootstrap.sh` file, you must also run + +```bash +bin/update-bootstrap-sha +``` + +To run all lints and tests: ```bash -$ ./test.sh +bin/test ``` + + +TODOS: +* How to diff brewfiles +* ssh config? +* Get resident keys? + * `ssh-keygen -K` +* Describe way of identifying untracked brew packages + * `brew bundle --verbose cleanup --file=homebrew/Brewfile.personal` diff --git a/test.sh b/bin/test similarity index 100% rename from test.sh rename to bin/test diff --git a/bin/update-bootstrap-sha b/bin/update-bootstrap-sha new file mode 100755 index 0000000..c5f8d5a --- /dev/null +++ b/bin/update-bootstrap-sha @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +BOOTSTRAP_SHA=$(sha256sum "${SCRIPT_DIR}/../bootstrap/bootstrap.sh" | awk '{ print $1 }') +# shellcheck disable=SC2016 +sed -i '' -e 's/\(sha256 checksum: `\)\(.*\)\(`\)/\1'"${BOOTSTRAP_SHA}"'\3/g' "${SCRIPT_DIR}/../README.md" diff --git a/bootstrap/macos.sh b/bootstrap/macos.sh index 4a7b064..2a83b58 100755 --- a/bootstrap/macos.sh +++ b/bootstrap/macos.sh @@ -23,6 +23,7 @@ setup_macos_dock() { } setup_macos_preferences() { + # TODO: FIX/Add to this osascript -e 'tell application "System Preferences" to quit' # Trackpad: enable tap to click for this user and for the login screen diff --git a/homebrew/Brewfile.base b/homebrew/Brewfile.base index eba5121..1167902 100644 --- a/homebrew/Brewfile.base +++ b/homebrew/Brewfile.base @@ -17,8 +17,11 @@ brew "zlib" # Yubikey/GPG brew "gnupg" brew "hopenpgp-tools" +brew "libfido2" +brew "openssh" brew "pinentry-mac" brew "ykman" +brew "ykpers" cask "yubico-authenticator" cask "yubico-yubikey-manager"