Skip to content

build and release workflow added #9

build and release workflow added

build and release workflow added #9

Workflow file for this run

name: "Build & Release"
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
permissions:
contents: write
jobs:
build:
name: Build & Release
runs-on: macos-latest
env:
API_KEY: ${{ secrets.API_KEY }}
CONTEXT_KEY: ${{ secrets.CONTEXT_KEY }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Java 17
uses: actions/setup-java@v2
with:
java-version: "17.x"
java-package: jdk
architecture: x64
check-latest: false
server-id: github
server-username: ${{ github.actor }}
server-password: ${{ secrets.GITHUB_TOKEN }}
overwrite-settings: true
job-status: success
distribution: "temurin"
- name: Create env file
run: |
cat > lib/config/api_keys.env << EOL
API_KEY=${{ secrets.API_KEY }}
CONTEXT_KEY=${{ secrets.CONTEXT_KEY }}
EOL
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
- name: build apk
run: flutter build apk --release --split-per-abi
- name: build ios
run: |
flutter build ios --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
ln -s ../Runner.app
cd ..
zip -r app.ipa Payload
- 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.GITHUB_TOKEN }}