v0.10.0 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested on MacOS with: | |
# act -s COMMITTER_TOKEN="$(gh auth token)" release --container-architecture linux/amd64 -P ubuntu-latest=catthehacker/ubuntu:act-latest -e <(echo '{ "release": { "tag_name": "v0.0.0" }}') | |
name: Update whisper-kit-expo | |
on: | |
release: | |
types: [released] | |
jobs: | |
update-whisperkit: | |
runs-on: ubuntu-latest | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
BRANCH_NAME: update-whisperkit-${{ github.event.release.tag_name }} | |
GH_TOKEN: ${{ secrets.COMMITTER_TOKEN }} | |
steps: | |
- name: Checkout whisper-kit-expo | |
uses: actions/checkout@v4 | |
with: | |
repository: seb-sep/whisper-kit-expo | |
token: ${{ secrets.COMMITTER_TOKEN }} | |
ref: main | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: New branch | |
run: | | |
git checkout -b $BRANCH_NAME | |
echo ${{ github.event.release }} | |
echo "Release tag is $TAG" | |
- name: Update package.json version | |
run: | | |
PACKAGE_PATH="package.json" | |
if [ ! -f "$PACKAGE_PATH" ]; then | |
echo "Could not find package.json at path: $PACKAGE_PATH." | |
exit 1 | |
fi | |
RELEASE_TAG=${TAG#v} | |
jq --arg newver "$RELEASE_TAG" '.whisperKit.version = $newver' "$PACKAGE_PATH" > tmp.$$.json && mv tmp.$$.json "$PACKAGE_PATH" | |
cat "$PACKAGE_PATH" | |
- name: Commit changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "argmaxincbot" | |
git add ./package.json | |
git commit -m "Update WhisperKit to $TAG" | |
git push origin $BRANCH_NAME | |
- name: PR with changes | |
env: | |
GH_TOKEN: ${{ secrets.COMMITTER_TOKEN }} | |
run: | | |
gh pr create --title "Update WhisperKit to $TAG" --body "Update WhisperKit to $TAG" --base main --head $BRANCH_NAME |