summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorCaleb Norton <[email protected]>2026-01-18 11:14:13 -0600
committerGitHub <[email protected]>2026-01-18 11:14:13 -0600
commitdac099a4892689d11abedb0fcc1098b50e0958c8 (patch)
treeb47a7a4bae294e0d4222fac21605a380d54b3341 /.github/workflows
parent5009f10406c15c4b69c04fa626756ee7bf81b300 (diff)
downloadopencode-dac099a4892689d11abedb0fcc1098b50e0958c8.tar.gz
opencode-dac099a4892689d11abedb0fcc1098b50e0958c8.zip
feat(nix): overhaul nix flake and packages (#9032)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/update-nix-hashes.yml77
1 files changed, 0 insertions, 77 deletions
diff --git a/.github/workflows/update-nix-hashes.yml b/.github/workflows/update-nix-hashes.yml
index f80a57d25..f9817fe1e 100644
--- a/.github/workflows/update-nix-hashes.yml
+++ b/.github/workflows/update-nix-hashes.yml
@@ -19,84 +19,7 @@ on:
- ".github/workflows/update-nix-hashes.yml"
jobs:
- update-flake:
- if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- runs-on: blacksmith-4vcpu-ubuntu-2404
- env:
- TITLE: flake.lock
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- fetch-depth: 0
- ref: ${{ github.head_ref || github.ref_name }}
- repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
-
- - name: Setup Nix
- uses: nixbuild/nix-quick-install-action@v34
-
- - name: Configure git
- run: |
- git config --global user.email "[email protected]"
- git config --global user.name "Github Action"
-
- - name: Update ${{ env.TITLE }}
- run: |
- set -euo pipefail
- echo "Updating $TITLE..."
- nix flake update
- echo "$TITLE updated successfully"
-
- - name: Commit ${{ env.TITLE }} changes
- env:
- TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
- run: |
- set -euo pipefail
-
- echo "Checking for changes in tracked files..."
-
- summarize() {
- local status="$1"
- {
- echo "### Nix $TITLE"
- echo ""
- echo "- ref: ${GITHUB_REF_NAME}"
- echo "- status: ${status}"
- } >> "$GITHUB_STEP_SUMMARY"
- if [ -n "${GITHUB_SERVER_URL:-}" ] && [ -n "${GITHUB_REPOSITORY:-}" ] && [ -n "${GITHUB_RUN_ID:-}" ]; then
- echo "- run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> "$GITHUB_STEP_SUMMARY"
- fi
- echo "" >> "$GITHUB_STEP_SUMMARY"
- }
- FILES=(flake.lock flake.nix)
- STATUS="$(git status --short -- "${FILES[@]}" || true)"
- if [ -z "$STATUS" ]; then
- echo "No changes detected."
- summarize "no changes"
- exit 0
- fi
-
- echo "Changes detected:"
- echo "$STATUS"
- echo "Staging files..."
- git add "${FILES[@]}"
- echo "Committing changes..."
- git commit -m "Update $TITLE"
- echo "Changes committed"
-
- BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
- echo "Pulling latest from branch: $BRANCH"
- git pull --rebase --autostash origin "$BRANCH"
- echo "Pushing changes to branch: $BRANCH"
- git push origin HEAD:"$BRANCH"
- echo "Changes pushed successfully"
-
- summarize "committed $(git rev-parse --short HEAD)"
-
compute-node-modules-hash:
- needs: update-flake
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
strategy:
fail-fast: false