Skip to content

Commit

Permalink
Update dart.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohitkoley authored May 2, 2024
1 parent 170d6aa commit e6685bb
Showing 1 changed file with 61 additions and 28 deletions.
89 changes: 61 additions & 28 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,75 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Dart
name: Build and upload APK

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
name: Build and Upload to release
permissions:
contents: write
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '12'

- name: Create .env File
run: |
echo "endpoint=\"http://127.0.0.1:8080/v1\"" > .env
echo "projectId='65de1d6f4e9108353385'" >> .env
echo "databaseId='65de26edd12df0816f0a'" >> .env
echo "userCollection='65df8b05d8fc420453c3'" >> .env
echo "tweetCollection=\"6609b25bbaa0bc7e444f\"" >> .env
echo "notificationCollections=\"66334b25bbd2dd547bdd\"" >> .env
# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.3'
channel: 'stable'

- name: verify flutter version
run: flutter --version

- name: Install dependencies
run: dart pub get
run: flutter pub get

- name: Build APK and ios
run: flutter build apk --release --split-per-abi
- run: |
flutter build ios --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
ln -s ../Runner.app
cd ..
zip -r app.ipa Payload
#upload apk to artifacts with the name weather_app.apk with each iteration inceament the version code
- name: Push to Releases
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*,build/ios/iphoneos/app.ipa"
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.GIT_TOKEN }}
body: |
- Build ${{ github.run_number }}
- Commit ${{ github.sha }}
- Branch ${{ github.ref }}
- Author ${{ github.actor }}```
name: v1.0.${{ github.run_number }}
prerelease: false
draft: false

# Uncomment this step to verify the use of 'dart format' on each commit.
# - name: Verify formatting
# run: dart format --output=none --set-exit-if-changed .

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze

# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
run: dart test

0 comments on commit e6685bb

Please sign in to comment.