-
Notifications
You must be signed in to change notification settings - Fork 334
57 lines (51 loc) · 2.03 KB
/
expo-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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 "164233781+argmaxincbot@users.noreply.github.com"
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