* android n ios * set this branch gh actions * set this branch gh actions2 * set this branch gh actions3 * set this branch gh actions4 * set this branch gh actions4.1 * set this branch gh actions5 * made executable * ... * ...2 * ...3 * ...4 * ...5 * ...6 * ...7 * ...88 * ios test keys * ios test keys2 * changed some fluufychat stuff * reset activation * pic update * reverted integrate to run again * ios-build1 * ios-build2 * android space clearing * another attempt * another attempt * another attempt2 * another attempt3 * android downgrade * undo cleanup * remove cache * sdk version force? * sdk version force remove * r8 fix * material * material remove agian * reset gradle, up flutter * downgfrade to 21 * android ndk up agian * android ndk up agian2 * with disk spcae r4emove agian... * allow ios modules * allow ios modules2 * updated version to compile on ios * how baout this * ios generated files * removed exclude group --------- Co-authored-by: ggurdin <ggurdin@gmail.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
214 lines
7.6 KiB
YAML
214 lines
7.6 KiB
YAML
name: Release Workflow
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
concurrency:
|
|
group: release_workflow
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
build_web:
|
|
runs-on: ubuntu-latest
|
|
environment: production
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
cache: true
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install nodejs -y
|
|
- name: Remove Emoji Font
|
|
run: |
|
|
rm -rf fonts/NotoEmoji
|
|
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml
|
|
- run: flutter pub get
|
|
- name: Prepare web
|
|
run: ./scripts/prepare-web.sh
|
|
- name: Update Website files
|
|
run: |
|
|
touch .env
|
|
touch assets/.env
|
|
echo "$WEB_APP_ENV" > .env
|
|
echo "$WEB_APP_ENV" > assets/.env
|
|
- name: Build Release Web
|
|
run: |
|
|
flutter config --enable-web
|
|
flutter clean
|
|
flutter pub get
|
|
flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps
|
|
- name: Create archive
|
|
run: tar -czf pangeachat-web.tar.gz build/web/
|
|
- name: Upload Web Build
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Web Build
|
|
path: pangeachat-web.tar.gz
|
|
- name: Upload files for deploy stage
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: web
|
|
path: build/web
|
|
- name: Upload to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: pangeachat-web.tar.gz
|
|
asset_name: pangeachat-web.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
build_apk:
|
|
runs-on: ubuntu-latest
|
|
environment: production
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
distribution: 'zulu'
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
cache: true
|
|
- name: Apply Google Services Patch
|
|
run: git apply ./scripts/enable-android-google-services.patch
|
|
- name: Remove Emoji Font
|
|
run: |
|
|
rm -rf fonts/NotoEmoji
|
|
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml
|
|
- run: flutter pub get
|
|
- name: Prepare Android Release Build
|
|
env:
|
|
FDROID_KEY: ${{ secrets.FDROID_KEY }}
|
|
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
|
|
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
|
|
run: ./scripts/prepare-android-release.sh
|
|
- run: flutter build apk --release
|
|
- name: Upload to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: build/app/outputs/apk/release/app-release.apk
|
|
asset_name: pangeachat.apk
|
|
asset_content_type: application/vnd.android.package-archive
|
|
|
|
build_linux:
|
|
strategy:
|
|
matrix:
|
|
arch: [ x64, arm64 ]
|
|
runs-on: ${{ matrix.arch == 'arm64' && 'self-hosted' || 'ubuntu-latest'}}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y
|
|
- name: Install Flutter
|
|
run: |
|
|
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
|
|
./flutter/bin/flutter doctor
|
|
- run: ./flutter/bin/flutter pub get
|
|
- run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }}
|
|
- name: Create archive
|
|
run: tar -czf pangeachat-linux-${{ matrix.arch }}.tar.gz -C build/linux/${{ matrix.arch }}/release/bundle/ .
|
|
- name: Upload to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: pangeachat-linux-${{ matrix.arch }}.tar.gz
|
|
asset_name: pangeachat-linux-${{ matrix.arch }}.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
deploy_playstore:
|
|
runs-on: ubuntu-latest
|
|
environment: production
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
distribution: 'zulu'
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
cache: true
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.3'
|
|
- name: Install Fastlane
|
|
run: gem install fastlane -NV
|
|
- name: Apply Google Services Patch
|
|
run: git apply ./scripts/enable-android-google-services.patch
|
|
- name: Remove Emoji Font
|
|
run: |
|
|
rm -rf fonts/NotoEmoji
|
|
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml
|
|
- run: flutter pub get
|
|
- name: Prepare Android Release Build
|
|
env:
|
|
FDROID_KEY: ${{ secrets.FDROID_KEY }}
|
|
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
|
|
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
|
|
run: ./scripts/prepare-android-release.sh
|
|
- name: Build Android Release
|
|
run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64
|
|
- name: Get Tag Name
|
|
id: tag_name
|
|
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"
|
|
- name: Deploy Android Release
|
|
run: |
|
|
mkdir -p build/android
|
|
cp build/app/outputs/bundle/release/app-release.aab build/android/
|
|
cd android
|
|
bundle install
|
|
bundle update fastlane
|
|
bundle exec fastlane deploy_internal_test
|
|
if [[ $GITHUB_REF_NAME == rc* ]]; then
|
|
bundle exec fastlane deploy_candidate
|
|
else
|
|
bundle exec fastlane deploy_release
|
|
fi
|
|
cd ..
|
|
|
|
deploy_web:
|
|
runs-on: ubuntu-latest
|
|
needs: build_web
|
|
environment: production
|
|
env:
|
|
WEBAPP_S3_BUCKET: ${{ vars.WEBAPP_S3_BUCKET }}
|
|
CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Download web
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: web
|
|
path: build/web
|
|
- name: Set up AWS CLI
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
- name: Copy files to the production website with the AWS CLI
|
|
run: |
|
|
aws s3 sync ./build/web s3://$WEBAPP_S3_BUCKET
|
|
- name: AWS CloudFront Invalidation
|
|
run: |
|
|
aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
|