Skip to content

Commit

Permalink
Pin to macos-14 runner; use Production env for test execution to ensu…
Browse files Browse the repository at this point in the history
…re data availability
  • Loading branch information
allanlang committed Sep 29, 2024
1 parent 4d79e01 commit 76aca94
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ on:
jobs:
test:
name: Build and test
runs-on: macos-latest
runs-on: macos-14
environment:
name: Test
name: Production
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install tools
run: |
brew install sunshinejr/formulae/pouch
- name: Generate Secrets.swift
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
Expand All @@ -30,6 +32,7 @@ jobs:
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch

- name: Build and test
env:
platform: ${{ 'iOS Simulator' }}
Expand All @@ -42,16 +45,18 @@ jobs:
build-publish-stage:
name: Build and publish - Stage
if: ${{ false }}
runs-on: macos-latest
runs-on: macos-14
needs: build-publish-prod
environment:
name: Stage
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install tools
run: |
brew install sunshinejr/formulae/pouch
- name: Generate Secrets.swift
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
Expand All @@ -64,8 +69,10 @@ jobs:
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch

- name: Set build number
run: agvtool new-version $GITHUB_RUN_NUMBER.1

- name: Configure Keychain
env:
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
Expand Down Expand Up @@ -94,15 +101,18 @@ jobs:
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Build archive
run: |
set -o pipefail
mkdir -p ~/build
xcodebuild clean archive -scheme "Tree Tracker" -project "Tree Tracker.xcodeproj" -sdk iphoneos -configuration Release -archivePath ~/build/Tree\ Tracker.xcarchive | xcpretty
- name: Export .ipa
run: |
set -o pipefail
xcodebuild -archivePath ~/build/Tree\ Tracker.xcarchive -exportOptionsPlist $GITHUB_WORKSPACE/Tree\ Tracker/ExportOptions.plist -exportPath ~/build -allowProvisioningUpdates -exportArchive | xcpretty
- name: Publish
if: ${{ success() && github.ref_name == 'main' && github.event_name != 'pull_request' }}
env:
Expand All @@ -114,16 +124,18 @@ jobs:
build-publish-prod:
name: Build and publish - Production
if: ${{ github.ref_name == 'main' && github.event_name != 'pull_request' }}
runs-on: macos-latest
runs-on: macos-14
needs: test
environment:
name: Production
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install tools
run: |
brew install sunshinejr/formulae/pouch
- name: Generate Secrets.swift
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
Expand All @@ -136,8 +148,10 @@ jobs:
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch

- name: Set build number
run: agvtool new-version $GITHUB_RUN_NUMBER

- name: Configure Keychain
env:
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
Expand Down Expand Up @@ -166,15 +180,18 @@ jobs:
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Build archive
run: |
set -o pipefail
mkdir -p ~/build
xcodebuild clean archive -scheme "Tree Tracker" -project "Tree Tracker.xcodeproj" -sdk iphoneos -configuration Release -archivePath ~/build/Tree\ Tracker.xcarchive | xcpretty
- name: Export .ipa
run: |
set -o pipefail
xcodebuild -archivePath ~/build/Tree\ Tracker.xcarchive -exportOptionsPlist $GITHUB_WORKSPACE/Tree\ Tracker/ExportOptions.plist -exportPath ~/build -allowProvisioningUpdates -exportArchive | xcpretty
- name: Publish
if: ${{ success() && github.ref_name == 'main' && github.event_name != 'pull_request' }}
env:
Expand Down

0 comments on commit 76aca94

Please sign in to comment.