Merge pull request #16 from aryonuwi/fe-20240209-home #21
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
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
name: "Build & Release" | ||
jobs: | ||
build: | ||
name: Build & Release | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up java 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.x' | ||
- name: Flutter get depedency | ||
run: flutter pub get | ||
- name: Push to releases debug | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' | ||
run: flutter build apk --debug | ||
- name: Push to releases debug | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "build/app/outputs/apk/debug/*" | ||
tag: v1.0.${{ github.run_number }}-Debug | ||
token: ${{ secrets.TOKEN }} | ||
- name : APK Release deploy | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'main' | ||
run: flutter build apk | ||
- name: Push to releases | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'main' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "build/app/outputs/apk/release/*" | ||
tag: v1.0.${{ github.run_number }}-Debug | ||
token: ${{ secrets.TOKEN }} | ||
# push to master, main, develop | ||
# pull request on main master | ||
# name: Build and Upload APK | ||
# on: | ||
# pull_request: | ||
# branches: | ||
# - main | ||
# - dev | ||
# push: | ||
# branches: | ||
# - main | ||
# - master | ||
# - develop | ||
# jobs: | ||
# build_and_upload_apk: | ||
# name: Build and Upload APK | ||
# runs-on: windows-latest | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
# - name: Set up java 11 | ||
# uses: actions/setup-java@v4 | ||
# with: | ||
# distribution: 'zulu' | ||
# java-version: '11' | ||
# - name: Setup Flutter | ||
# uses: subosito/flutter-action@v2 | ||
# with: | ||
# flutter-version: '3.x' | ||
# - name: Install dependencies | ||
# run: flutter pub get | ||
# - name: Build APK | ||
# run: flutter build apk | ||
# - name: Save APK artifact | ||
# if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'dev' | ||
# uses: ncipollo/release-action@v1 | ||
# with: | ||
# name: debug-apk | ||
# path: build/app/outputs/flutter-apk/app-debug.apk | ||
# tag: v1.0.${{github.run_number}}-test | ||
# token: ${{ secrets.TOKEN }} | ||
# artifacts: "build/app/outputs/apk/debug/*" | ||
# - name: Release APK | ||
# if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'main' | ||
# run: flutter build apk --release | ||
# - name: Save Release APK artifact | ||
# if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'main' | ||
# uses: ncipollo/release-action@v1 | ||
# with: | ||
# name: release-apk | ||
# path: build/app/outputs/flutter-apk/app-release.apk | ||
# tag: v1.0.${{github.run_number}} | ||
# token: ${{ secrets.TOKEN }} | ||
# artifacts: "build/app/outputs/flutter-apk/*" | ||
# - name: Save Release APK artifact | ||
# if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'main' | ||
# uses: ncipollo/release-action@v1 | ||
# with: | ||
# name: release-apk | ||
# path: build/app/outputs/flutter-apk/app-release.apk | ||
# tag: v1.0.${{github.run_number}} | ||
# token: ${{ secrets.TOKEN }} | ||
# artifacts: "build/app/outputs/flutter-apk/*" | ||
# - name: Upload APK to GitHub Release | ||
# if: github.event_name == 'pull_request' && (github.event.pull_request.head.ref == 'dev' || github.event.pull_request.head.ref == 'main') | ||
# uses: morrisjobke/upload-to-release@v1 | ||
# with: | ||
# files: | | ||
# build/app/outputs/flutter-apk/app-debug.apk | ||
# build/app/outputs/flutter-apk/app-release.apk | ||
# repo_token: ${{ secrets.TOKEN }} | ||
# tag: ${{ github.sha }} | ||