Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
GitHub Actions workflow to build Flutter app and create Release, put this file under `.github/workflows` folder.
- master
name: Build and Release Apps
name: Build Apps
runs-on: macos-latest
- name: Export Release Timestamp
run: echo "::set-env name=APP_VERSION::release_$(date +'%Y-%m-%d_%H-%m-%S')"
- name: Checkout repository
uses: actions/checkout@v1
- name: Set up Java
uses: actions/setup-java@v1
java-version: "12.x"
- name: Set up Flutter
uses: subosito/flutter-action@v1
channel: "stable"
- name: Install pub Dependencies
run: flutter pub get
- name: Run Tests
run: flutter test
- name: Build Android App
run: flutter build apk --split-per-abi
- name: Build iOS App
run: |
flutter build ios --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
ln -s ../
cd ..
zip -r app.ipa Payload
- name: Release Apps
uses: ncipollo/release-action@v1
tag: ${{ env.APP_VERSION }}
name: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "build/app/outputs/apk/release/*.apk,build/ios/iphoneos/app.ipa"

This comment has been minimized.

Copy link

@sank8dalvi sank8dalvi commented Nov 21, 2020

set-env is deprecated in github actions and thus Export Release Timestamp is giving a error.
You can make changes according to the new environment file handling on github
Please update the run command with the following new syntax to fix it.

echo "APP_VERSION=release_$(date +'%Y-%m-%d_%H-%m-%S')" >> $GITHUB_ENV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment