Build iAPS dev-bo #59
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
name: 4. Build iAPS dev-bo | |
run-name: Build iAPS dev-bo | |
on: | |
workflow_dispatch: | |
workflow_call: | |
## Remove the "#" sign from the beginning of the line below to get automated builds on push (code changes in your repository) | |
#push: | |
## Remove the "#" sign from the beginning of the two lines below to get automated builds every two months | |
schedule: | |
- cron: '0 4 * * *' # Runs at 04 UTC every day | |
env: | |
UPSTREAM_REPO: Artificial-Pancreas/iAPS | |
UPSTREAM_BRANCH: dev # upstream branch to sync from | |
TARGET_BRANCH: dev-bo # branch on fork to build from | |
SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository | |
jobs: | |
secrets: | |
uses: ./.github/workflows/validate_secrets.yml | |
secrets: inherit | |
build: | |
needs: secrets | |
runs-on: macos-12 | |
steps: | |
# Uncomment to manually select latest Xcode if needed | |
- name: Select Latest Xcode | |
run: "sudo xcode-select --switch /Applications/Xcode_14.1.app/Contents/Developer" | |
# Checks-out the repo | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_BRANCH }} | |
# Run the sync action | |
- name: Sync upstream changes | |
if: ${{ env.SYNC_UPSTREAM == 'true' }} | |
id: sync | |
uses: aormsby/[email protected] | |
with: | |
target_sync_branch: ${{ env.TARGET_BRANCH }} | |
shallow_since: 6 months ago | |
target_repo_token: ${{ secrets.GH_PAT }} | |
upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} | |
upstream_sync_repo: ${{ env.UPSTREAM_REPO }} | |
# Step 3: Display a sample message based on the sync output var 'has_new_commits' | |
- name: New commits found | |
if: steps.sync.outputs.has_new_commits == 'true' | |
run: echo "New commits were found to sync." | |
- name: No new commits | |
if: steps.sync.outputs.has_new_commits == 'false' | |
run: echo "There were no new commits." | |
- name: Show value of 'has_new_commits' | |
run: echo ${{ steps.sync.outputs.has_new_commits }} | |
# Patch Fastlane Match to not print tables | |
- name: Patch Match Tables | |
run: find /usr/local/lib/ruby/gems -name table_printer.rb | xargs sed -i "" "/puts(Terminal::Table.new(params))/d" | |
# Build signed iAPS IPA file | |
- name: Fastlane Build & Archive | |
run: fastlane build_iAPS | |
env: | |
TEAMID: ${{ secrets.TEAMID }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} | |
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} | |
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
# Upload to TestFlight | |
- name: Fastlane upload to TestFlight | |
run: fastlane release | |
env: | |
TEAMID: ${{ secrets.TEAMID }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} | |
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} | |
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
# Upload IPA and Symbols | |
- name: Upload IPA and Symbol artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: | | |
artifacts | |
buildlog |