Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expo release script #220

Merged
merged 1 commit into from
Oct 14, 2024
Merged
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
24 changes: 2 additions & 22 deletions .github/workflows/expo-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,12 @@ jobs:
- name: Update package.json version
run: |
PACKAGE_PATH="package.json"

# Check if the package.json exists at the specified path
if [ ! -f "$PACKAGE_PATH" ]; then
echo "Could not find package.json at path: $PACKAGE_PATH."
exit 1
fi

# Normalize the release tag by removing a leading 'v', if present
RELEASE_TAG=${TAG#v}

# Update package.json with the new version
jq --arg newver "$RELEASE_TAG" '.whisperKit.version = $newver' "$PACKAGE_PATH" > tmp.$$.json && mv tmp.$$.json "$PACKAGE_PATH"

# Verify changes
cat "$PACKAGE_PATH"

- name: Commit changes
Expand All @@ -58,20 +50,8 @@ jobs:
git add ./package.json
git commit -m "Update WhisperKit to $TAG"
git push origin $BRANCH_NAME

- name: Install and setup GitHub CLI if necessary
run: |
if ! command -v gh &> /dev/null
then
echo "GitHub CLI is not installed, installing..."
sudo apt update
sudo apt install -y gh
else
echo "GitHub CLI is already installed"
fi

- name: PR with changes
env:
GH_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
run: |
echo ${{ secrets.COMMITTER_TOKEN }} | gh auth login --with-token
gh pr create --title "Update WhisperKit to $TAG" --body "Update WhisperKit to $TAG" --base main --head $BRANCH_NAME