Skip to content

Commit

Permalink
CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
Dante291 committed Nov 30, 2023
1 parent 8dbc486 commit f6227c0
Showing 1 changed file with 36 additions and 44 deletions.
80 changes: 36 additions & 44 deletions .github/workflows/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,51 @@ on:
- main

jobs:
build:
build-ios:
name: Build iOS app
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- uses: actions/checkout@v2

- name: Install Dependencies
run: flutter pub get
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # Use a supported Java distribution
java-version: '12.0'

- name: Build iOS App
run: flutter build ios --release --no-codesign
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable' # Can be 'beta', 'dev', or 'master'

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ios-build
path: build/ios/iphoneos/Runner.app
- name: Install dependencies
run: flutter pub get

release:
needs: build
runs-on: ubuntu-latest
- name: Build iOS app
run: flutter build ios --release --no-codesign
# '--no-codesign' is used for building without code signing.
# For actual distribution, proper code signing is required.

steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ios-build
path: build/ios
########################################################
## Package the app as an .ipa and create a release ##
########################################################

- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Package .ipa file
run: |
mkdir Payload
cp -r build/ios/iphoneos/Runner.app Payload/Runner.app
zip -r app.ipa Payload
# This packages the Runner.app into an .ipa file

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/ios/iphoneos/Runner.app.zip
asset_name: ios-app.zip
asset_content_type: application/zip
token: ${{ secrets.MY_GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
with:
name: "Automated iOS Release"
artifacts: "app.ipa"
allowUpdates: "true"
generateReleaseNotes: false
tag: "automated"
body: |
This is an automated release, triggered by a recent push.
This may or may not be stable, so please have a look at the stable release(s).
Android-Build-and-Release:
Expand Down

0 comments on commit f6227c0

Please sign in to comment.