This commit is contained in:
Mitchell Hashimoto
2024-12-12 13:42:44 -08:00
parent 9b4e3622aa
commit 5a085267ca

View File

@ -16,52 +16,51 @@ jobs:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.0
with: with:
path: | path: |
/nix /nix
/zig /zig
- name: Setup Nix - name: Setup Nix
uses: cachix/install-nix-action@v30 uses: cachix/install-nix-action@v30
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v15
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Run zig fetch - name: Run zig fetch
id: zig_fetch id: zig_fetch
run: | run: |
UPSTREAM_REV="$(curl "https://api.github.com/repos/mbadolato/iTerm2-Color-Schemes/commits/master" | jq -r '.sha')" UPSTREAM_REV="$(curl "https://api.github.com/repos/mbadolato/iTerm2-Color-Schemes/commits/master" | jq -r '.sha')"
nix develop -c zig fetch --save="iterm2_themes" "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/$UPSTREAM_REV.tar.gz" nix develop -c zig fetch --save="iterm2_themes" "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/$UPSTREAM_REV.tar.gz"
echo "upstream_rev=$UPSTREAM_REV" >> "$GITHUB_OUTPUT" echo "upstream_rev=$UPSTREAM_REV" >> "$GITHUB_OUTPUT"
- name: Update zig cache hash - name: Update zig cache hash
run: | run: |
# Only proceed if build.zig.zon has changed # Only proceed if build.zig.zon has changed
if ! git diff --exit-code build.zig.zon; then if ! git diff --exit-code build.zig.zon; then
nix develop -c ./nix/build-support/check-zig-cache-hash.sh --update nix develop -c ./nix/build-support/check-zig-cache-hash.sh --update
fi fi
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
title: Update iTerm2 colorschemes
base: main
branch: iterm2_colors_action
commit-message: "deps: Update iTerm2 color schemes"
add-paths: |
build.zig.zon
nix/zigCacheHash.nix
body: |
Upstream revision: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/${{ steps.zig_fetch.outputs.upstream_rev }}
labels: dependencies
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
title: Update iTerm2 colorschemes
base: main
branch: iterm2_colors_action
commit-message: "deps: Update iTerm2 color schemes"
add-paths: |
build.zig.zon
nix/zigCacheHash.nix
body: |
Upstream revision: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/${{ steps.zig_fetch.outputs.upstream_rev }}
labels: dependencies