fluffychat/.github/workflows/release.yaml

174 lines
6.2 KiB
YAML
Raw Normal View History

2023-07-15 00:37:55 +00:00
name: Release Workflow
on:
release:
types:
- created
concurrency:
group: release_workflow
cancel-in-progress: true
jobs:
build_web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-15 00:37:55 +00:00
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-15 00:37:55 +00:00
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install nodejs -y
- run: flutter pub get
- name: Prepare web
run: ./scripts/prepare-web.sh
- name: Build Release Web
2023-07-29 09:03:33 +00:00
run: flutter build web --release --source-maps
2023-07-15 00:37:55 +00:00
- name: Create archive
2023-07-29 10:18:36 +00:00
run: tar -czf fluffychat-web.tar.gz build/web/
2023-07-29 09:03:33 +00:00
- name: Upload Web Build
uses: actions/upload-artifact@v2
with:
name: Web Build
2023-07-29 10:18:36 +00:00
path: fluffychat-web.tar.gz
2023-07-29 09:03:33 +00:00
- name: Upload to release
uses: actions/upload-release-asset@v1
env:
2023-07-29 10:07:01 +00:00
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
2023-07-29 09:03:33 +00:00
with:
upload_url: ${{ github.event.release.upload_url }}
2023-07-29 10:18:36 +00:00
asset_path: fluffychat-web.tar.gz
asset_name: fluffychat-web.tar.gz
2023-07-29 09:03:33 +00:00
asset_content_type: application/gzip
2023-07-15 00:37:55 +00:00
build_apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-15 00:37:55 +00:00
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-15 00:37:55 +00:00
- name: Apply Google Services Patch
run: git apply ./scripts/enable-android-google-services.patch
- 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
2023-07-29 09:03:33 +00:00
- name: Upload to release
uses: actions/upload-release-asset@v1
env:
2023-07-29 10:07:01 +00:00
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
2023-07-29 09:03:33 +00:00
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/app/outputs/apk/release/app-release.apk
asset_name: fluffychat.apk
2023-07-29 09:03:33 +00:00
asset_content_type: application/vnd.android.package-archive
2023-07-15 00:37:55 +00:00
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-15 00:37:55 +00:00
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-15 00:37:55 +00:00
- 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 -y
- run: flutter pub get
2023-07-30 08:32:10 +00:00
- run: flutter build linux --release --target-platform linux-x64
2023-07-15 00:37:55 +00:00
- name: Create archive
2023-07-30 08:32:10 +00:00
run: tar -czf fluffychat-linux-x64.tar.gz build/linux/x64/release/bundle/
2023-07-29 09:03:33 +00:00
- name: Upload to release
uses: actions/upload-release-asset@v1
env:
2023-07-29 10:07:01 +00:00
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
2023-07-29 09:03:33 +00:00
with:
upload_url: ${{ github.event.release.upload_url }}
2023-07-30 08:32:10 +00:00
asset_path: fluffychat-linux-x64.tar.gz
asset_name: fluffychat-linux-x64.tar.gz
2023-07-29 09:03:33 +00:00
asset_content_type: application/gzip
2023-07-15 00:37:55 +00:00
deploy_playstore:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-15 00:37:55 +00:00
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-15 00:37:55 +00:00
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install Fastlane
run: gem install fastlane -NV
- name: Apply Google Services Patch
run: git apply ./scripts/enable-android-google-services.patch
- 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
2023-07-25 04:30:22 +00:00
bundle exec fastlane deploy_internal_test
2023-08-07 05:58:29 +00:00
if [[ $GITHUB_REF_NAME == rc* ]]; then
2023-07-15 00:37:55 +00:00
bundle exec fastlane deploy_candidate
else
bundle exec fastlane deploy_release
fi
cd ..
2023-08-07 05:58:29 +00:00
promote_snapcraft:
2023-08-07 05:58:29 +00:00
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
2023-08-07 05:58:29 +00:00
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Install expect
run: sudo apt-get update && sudo apt-get install -y expect
- name: Promote Snap
2023-08-09 17:16:10 +00:00
run: |
RELEASE_TYPE=$(echo "${{ github.ref }}" | awk -F"/" '{print $3}')
if [ "$RELEASE_TYPE" = "rc" ]; then
expect -c "
spawn snapcraft promote fluffychat --from-channel edge --to-channel candidate
expect \"Do you want to promote the current set to the 'candidate' channel? [y/N]:\"
send \"y\r\"
expect eof
"
2023-08-09 17:16:10 +00:00
else
snapcraft promote fluffychat --from-channel candidate --to-channel stable --yes
2023-09-05 12:48:18 +00:00
fi