Skip to content

Instantly share code, notes, and snippets.

View aChase55's full-sized avatar

Alex Chase aChase55

  • Los Angeles
View GitHub Profile
- name: Upload Build
id: build-upload
uses: nick-invision/retry@v2
with:
timeout_minutes: 15
max_attempts: 5
retry_wait_seconds: 120
retry_on: error
command: ./scripts/build-upload.sh
env:
echo "Export Build" $BUILD_PATH
xcodebuild -exportArchive \
-archivePath "$ARCHIVE_PATH" \
-exportPath "$BUILD_PATH" \
-exportOptionsPlist $PWD/ExportOptions.plist \
| xcpretty
xcodebuild \
-project Whatnot.xcodeproj \
-scheme "$SCHEME" \
-configuration "Release" \
-destination "generic/platform=iOS" \
archive -archivePath "$ARCHIVE_PATH" \
SWIFT_ACTIVE_COMPILATION_CONDITIONS=$SWIFT_ACTIVE_COMPILATION_CONDITIONS \
CODE_SIGN_STYLE=Manual \
WN_APP_ICON=$APP_ICON_NAME \
WN_BUILD_NUMBER=$BUILD_NUMBER \
SCHEME="Whatnot"
APP_ICON_NAME=AppIcon
SWIFT_ACTIVE_COMPILATION_CONDITIONS="\$(inherited)"
if [[ "$BUILD_CONFIGURATION" != "Release" ]]; then
APP_ICON_NAME=AppIcon-$BUILD_CONFIGURATION
SWIFT_ACTIVE_COMPILATION_CONDITIONS="\$(inherited) INTERNAL"
Fi
ARCHIVE_NAME="$SCHEME.xcarchive"
BUILD_PATH=$PWD/build/
ARCHIVE_PATH=$BUILD_PATH"$ARCHIVE_NAME"
#Slug format is version-build-configuration
VERSION_NUMBER=${SLUG%%-*}
BUILD_AND_VERSION=${SLUG#*-}
BUILD_NUMBER=${BUILD_AND_VERSION%%-*}
BUILD_CONFIGURATION=${SLUG##*-}
if ! [[ "$BUILD_CONFIGURATION" =~ ^(Debug|Release)$ ]]; then
echo "INVALID CONFIGURATION: " $BUILD_CONFIGURATION
exit 1
fi
- name: Archive and Export
id: build-archive-export
run: ./scripts/build-archive-export.sh
env:
SLUG: ${{ env.GITHUB_REF_SLUG_CS }}
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
jobs:
build-upload:
runs-on: macos-12
steps:
- name: Check base ref
id: check-base-ref
run: |
REF=${{ github.event.base_ref }}
if ! [[ $REF =~ ^refs/heads/(main|release/.*)$ ]]; then
echo "Deployments via tagging must be done against the main or release branch";
@aChase55
aChase55 / tag-filters.yml
Created October 20, 2022 18:51
Tag filters
name: build-upload
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+-Debug'
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+-Release'
@aChase55
aChase55 / tag-builds.yml
Created October 20, 2022 18:50
Tag builds
name: Tag Builds
on:
workflow_call:
jobs:
tag-builds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with: