Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Release
on:
push:
branches:
- 'main'
- 'ryanbutler-orbs-1278-auto-bump-orb-os-on-orb-rustzone-merge'
# - 'main'

permissions: {}

Expand Down Expand Up @@ -49,8 +50,6 @@ jobs:
ls -aRsh
popd



- name: Upload Release and Create Tag
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # pin@v1
if: ${{ github.ref_name == github.event.repository.default_branch }}
Expand All @@ -59,3 +58,50 @@ jobs:
fail_on_unmatched_files: true
overwrite_files: false
files: artifacts/*

- name: Checkout orb-os
uses: actions/checkout@v4
with:
repository: worldcoin/orb-os
# token: ${{ secrets.ORB_OS_PR_TOKEN }}
path: orb-os

- name: Update ORB_RUSTZONE in target files
working-directory: orb-os
shell: bash
run: |
set -Eeuxo pipefail
release_name='git-${{ steps.compute_version.outputs.short_sha }}'

# Build bash array "files" either from workflow_dispatch input (newline-separated)
# or from DEFAULT_BUMP_FILES (space-separated).
declare -a files=("diamond/common.sh")

# Update each file
for commonsh in "${files[@]}"; do
if [[ ! -f "$commonsh" ]]; then
echo "ERROR: file does not exist: $commonsh" >&2
exit 1
fi

# Replace only the value inside ORB_RUSTZONE="...".
regex='^(declare -rx[[:space:]]+ORB_RUSTZONE=")[^"]*(".*)$'
sed -i -E "s/${regex}/\1${release_name}\2/" "${commonsh}"

echo "Updated ${commonsh}:"
grep -n -E "${regex}" "$file"
done
git diff

- name: Create PR in orb-os
uses: peter-evans/create-pull-request@v6
with:
# token: ${{ secrets.ORB_OS_PR_TOKEN }}
path: orb-os
branch: bump-bot/orb-rustzone-${{ steps.compute_version.outputs.short_sha }}
commit-message: "chore: bump ORB_RUSTZONE to ${{ steps.compute_version.outputs.short_sha }}"
title: "chore: bump ORB_RUSTZONE to ${{ steps.compute_version.outputs.short_sha }}"
body: |
see title
base: main

2 changes: 1 addition & 1 deletion .github/workflows/ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
- uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15
# not on prod to eliminate privilege escalation via cachix cache injection
if: ${{ matrix.environment }} == 'stage'
if: ${{ matrix.environment == 'stage' }}
continue-on-error: true
with:
name: worldcoin
Expand Down
Loading