Skip to content

Commit

Permalink
[workflow] - Bring back iOS prebuild (#192)
Browse files Browse the repository at this point in the history
* workflow - Bring back iOS prebuild

* workflows - iOS | Mention secrets

* workflows - aline all the secrets
  • Loading branch information
bricefriha authored Feb 11, 2025
1 parent 4352787 commit ec2a69a
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/cd-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ on:
required: true
appstore-private-key:
required: true
discord_client_id:
required: true
api_host:
required: true
monitoring_key:
required: true
jobs:
publish-ios:
runs-on: macos-15
Expand Down Expand Up @@ -68,8 +74,18 @@ jobs:
# model: 'iPhone 16'
# os_version: 18.2

# This step might be obsolete at some point as .NET MAUI workloads
# are starting to come pre-installed on the GH Actions build agents.
# Build Environement variables
- name: Environement variables
run: |
chmod +x ./App/builds/ios_prebuild.sh
./App/builds/ios_prebuild.sh
shell: bash
env:
discord_client_id: ${{ secrets.discord_client_id }}
api_host: ${{ secrets.api_host }}
monitoring_key: ${{ secrets.monitoring_key }}
project_folder: '.'

- name: Install MAUI Workload
run: |
dotnet workload install maui --ignore-failed-sources
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
appstore-issuer: ${{ secrets.APPSTORE_ISSUER_ID }}
appstore-keyid: ${{ secrets.APPSTORE_KEY_ID }}
appstore-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
discord_client_id: ${{ secrets.DISCORD_CLIENT_ID }}
api_host: ${{ secrets.API_HOST }}
monitoring_key: ${{ secrets.MONITORING_KEY }}
build-android:
needs: setup
uses: ./.github/workflows/cd-android.yml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
appstore-issuer: ${{ secrets.APPSTORE_ISSUER_ID }}
appstore-keyid: ${{ secrets.APPSTORE_KEY_ID }}
appstore-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
discord_client_id: ${{ secrets.DISCORD_CLIENT_ID }}
api_host: ${{ secrets.API_HOST }}
monitoring_key: ${{ secrets.MONITORING_KEY }}
build-android:
needs: setup
uses: ./.github/workflows/cd-android.yml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
appstore-issuer: ${{ secrets.APPSTORE_ISSUER_ID }}
appstore-keyid: ${{ secrets.APPSTORE_KEY_ID }}
appstore-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
discord_client_id: ${{ secrets.DISCORD_CLIENT_ID }}
api_host: ${{ secrets.API_HOST }}
monitoring_key: ${{ secrets.MONITORING_KEY }}
build-android:
needs: setup
uses: ./.github/workflows/cd-android.yml
Expand Down
36 changes: 36 additions & 0 deletions App/builds/ios_prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
echo "Launching ios pre-build script"
if [ -z "$discord_client_id" ]
then
echo "You need define the discord_client_id variable in App Center"
exit
fi
if [ -z "$api_host" ]
then
echo "You need define the api_host variable in App Center"
exit
fi
if [ -z "$monitoring_key" ]
then
echo "You need define the monitoring_key variable in App Center"
exit
fi

APP_CONSTANT_FILE=$project_folder/App/Core/AppConstant.cs

if [ -e "$APP_CONSTANT_FILE" ]
then
echo "Updating AppConstant.cs"
echo "---"
echo "DiscordClientId = "$discord_client_id
sed -i '' 's#DiscordClientId = Environment.GetEnvironmentVariable("discord_client_id")#DiscordClientId = "'$discord_client_id'"#g' $APP_CONSTANT_FILE
echo "ApiHost = "$api_host
sed -i '' 's#ApiHost = Environment.GetEnvironmentVariable("api_host")#ApiHost = "'$api_host'"#g' $APP_CONSTANT_FILE
echo "MonitoringKey = "$monitoring_key
sed -i '' 's#MonitoringKey = Environment.GetEnvironmentVariable("monitoring_key")#MonitoringKey = "'$monitoring_key'"#g' $APP_CONSTANT_FILE
echo "File content:"
cat $APP_CONSTANT_FILE
else
echo "Incorrect file: "$APP_CONSTANT_FILE
exit
fi

0 comments on commit ec2a69a

Please sign in to comment.