-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update script and fix all annotation warnings
- Loading branch information
1 parent
9e1c06b
commit 0bc2655
Showing
3 changed files
with
85 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# Variables passed as environment | ||
TOKEN=$GITHUB_TOKEN | ||
TAG_NAME=$TAG_NAME | ||
RELEASE_NAME=$RELEASE_NAME | ||
BODY=$BODY | ||
DRAFT=$DRAFT | ||
PRE_RELEASE=$PRE_RELEASE | ||
|
||
# Repository info | ||
REPO_OWNER=$(jq -r ".repository.owner.login" $GITHUB_EVENT_PATH) | ||
REPO_NAME=$(jq -r ".repository.name" $GITHUB_EVENT_PATH) | ||
|
||
# GitHub API URL for creating a release | ||
API_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases" | ||
|
||
# Data for the release | ||
DATA=$(jq -n --arg tag_name "$TAG_NAME" \ | ||
--arg name "$RELEASE_NAME" \ | ||
--arg body "$BODY" \ | ||
--arg draft "$DRAFT" \ | ||
--arg prerelease "$PRE_RELEASE" \ | ||
'{tag_name: $tag_name, name: $name, body: $body, draft: $draft, prerelease: $prerelease}') | ||
|
||
# Make a POST request to create the release | ||
RESPONSE=$(curl -H "Authorization: token $TOKEN" \ | ||
-H "Content-Type: application/json" \ | ||
--data "$DATA" \ | ||
$API_URL) | ||
|
||
# Check if the release was successfully created | ||
RELEASE_ID=$(echo $RESPONSE | jq -r ".id") | ||
|
||
if [ "$RELEASE_ID" != "null" ]; then | ||
echo "Release created successfully! ID: $RELEASE_ID" | ||
else | ||
echo "Failed to create release" | ||
echo "Response:" | ||
echo $RESPONSE | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Variables passed from the workflow | ||
ASSET_URL=$1 | ||
NEW_VERSION=$2 | ||
GITHUB_TOKEN=$3 | ||
|
||
# Trim off the end of the URL | ||
ASSET_URL="${ASSET_URL%\{*}" | ||
|
||
echo "Uploading Android App..." | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Type: $(file -b --mime-type ./android.wdio.native.app.$NEW_VERSION.apk)" \ | ||
--data-binary @./android.wdio.native.app.$NEW_VERSION.apk \ | ||
"$ASSET_URL?name=android.wdio.native.app.$NEW_VERSION.apk" | ||
|
||
echo "Uploading iOS App..." | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Type: $(file -b --mime-type ./ios.simulator.wdio.native.app.$NEW_VERSION.zip)" \ | ||
--data-binary @./ios.simulator.wdio.native.app.$NEW_VERSION.zip \ | ||
"$ASSET_URL?name=ios.simulator.wdio.native.app.$NEW_VERSION.zip" |
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