fix: Fix linter warnings #400
Workflow file for this run
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: Deploy to Firebase [Ruuvi Station] | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to build and upload' | |
required: true | |
default: 'main' | |
jobs: | |
build: | |
if: (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) | |
runs-on: macos-13 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15' | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Remove existing localisation directory | |
run: rm -rf ${{ github.workspace }}/station.localization | |
- name: Clone localisation submodule | |
run: git clone -b dev https://github.com/ruuvi/station.localization.git ${{ github.workspace }}/station.localization | |
- name: Install the Apple certificate and provisioning profiles | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode > $CERTIFICATE_PATH | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
echo -n "${{ secrets.MAIN_APP_ADHOC_PROVISION_PROFILE_BASE64 }}" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/match_AdHoc_com.ruuvi.station.mobileprovision | |
echo -n "${{ secrets.WIDGETS_APP_ADHOC_PROVISION_PROFILE_BASE64 }}" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/match_AdHoc_com.ruuvi.station.widgets.mobileprovision | |
echo -n "${{ secrets.INTENTS_APP_ADHOC_PROVISION_PROFILE_BASE64 }}" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/match_AdHoc_com.ruuvi.station.intents.mobileprovision | |
echo -n "${{ secrets.PNSERVICE_APP_ADHOC_PROVISION_PROFILE_BASE64 }}" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/match_AdHoc_com.ruuvi.station.pnservice.mobileprovision | |
- name: Increment build number | |
run: | | |
make set_build_number | |
- name: Tools cache | |
uses: actions/cache@v4 | |
with: | |
path: .tools/ | |
key: ${{ runner.os }}-tools-${{ hashFiles('/.tools/') }} | |
restore-keys: | | |
${{ runner.os }}-tools- | |
- name: Make xcodeproj | |
run: | | |
make xcodeproj | |
- name: Resolve Swift Packages | |
run: | | |
xcodebuild -resolvePackageDependencies | |
- name: SPM Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/Library/Developer/Xcode/DerivedData/Ruuvi*/SourcePackages/ | |
key: ${{ runner.os }}-Ruuvi-${{ hashFiles('Ruuvi.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-Ruuvi- | |
- name: Build app | |
run: | | |
xcodebuild -project Ruuvi.xcodeproj -scheme station -configuration Alpha -archivePath ./Build/Station_Dev.xcarchive archive -allowProvisioningUpdates -quiet | |
- name: Export IPA | |
env: | |
EXPORT_PLIST: ${{ secrets.ADHOC_EXPORT_OPTIONS }} | |
run: | | |
EXPORT_PLIST_PATH=${{ runner.temp }}/ExportOptions.plist | |
echo -n "$EXPORT_PLIST" | base64 --decode > $EXPORT_PLIST_PATH | |
xcodebuild -exportArchive -archivePath ./Build/Station_Dev.xcarchive -exportOptionsPlist $EXPORT_PLIST_PATH -exportPath ${{ runner.temp }}/export | |
- name: Get latest commit message | |
id: latest_commit | |
run: | | |
COMMIT_MESSAGE=$(git log -1 --pretty=%B) | |
echo "Commit Message: $COMMIT_MESSAGE" | |
echo "$COMMIT_MESSAGE" > commit_message.txt | |
echo "::set-output name=message::$COMMIT_MESSAGE" | |
- name: Install firebase CLI | |
run: | | |
make installed_firebase | |
- name: Distribute to Firebase | |
run: | | |
.tools/firebase/firebase appdistribution:distribute ${{ runner.temp }}/export/*.ipa \ | |
--app ${{ secrets.GOOGLE_APP_ID }} \ | |
--token ${{ secrets.FIREBASE_REFRESH_TOKEN }} \ | |
--groups ${{ secrets.ALPHA_TESTERS_GROUP }} \ | |
--release-notes "$(cat commit_message.txt)" | |
- name: Clean up keychain and provisioning profiles | |
if: ${{ always() }} | |
run: | | |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db | |
rm -rf ~/Library/MobileDevice/Provisioning\ Profiles/* |