This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve and fix release workflows (#546)
* Update Gemfile.lock * Bump pubspec.lock versions * Disable deferred loading * Fix release workflow versions * Update release.yml * add create_tag workflow * rename release workflows * Update create_tag.yml * Update release instructions * Update README.md * empty commit * Use secrets.FLUTTERGITHUBBOT_TOKEN * x * x * x * x * Update create_tag.yml * Update create_tag.yml * bump up version * add permission * update token * use own * Revert "use own" This reverts commit 729d180. * Update README.md * Delete create_tag.yml
- Loading branch information
Showing
9 changed files
with
312 additions
and
272 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
.github/workflows/deploy_play_store.yml → ...b/workflows/release_deploy_play_store.yml
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
6 changes: 3 additions & 3 deletions
6
.github/workflows/deploy_web.yml → .github/workflows/release_deploy_web.yml
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
name: Draft Github Release | ||
on: | ||
# Enable manual run | ||
workflow_dispatch: | ||
# Refs/tags push events to matching v*, i.e. v1.0, v20.15.10 | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
generate-changelog: | ||
name: Generate changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get latest published release tag | ||
id: get_latest_release | ||
uses: pozetroninc/github-action-get-latest-release@2b51d48e904071035d6632715d41966f516711dd | ||
with: | ||
repository: ${{ github.repository }} | ||
excludes: prerelease, draft | ||
- name: Generate changelog since last published release | ||
uses: charmixer/auto-changelog-action@5c6320ae4dedc8743e4439a3c56294c294553fb9 | ||
with: | ||
token: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} | ||
future_release: ${{ github.ref }} | ||
since_tag: ${{ steps.get_latest_release.outputs.release }} | ||
- name: Upload changelog | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: changelog | ||
path: CHANGELOG.md | ||
|
||
draft-release: | ||
name: Draft Github release | ||
needs: generate-changelog | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Download changelog | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: changelog | ||
- name: Draft release with changelog | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Flutter Gallery ${{ github.ref }} | ||
body_path: CHANGELOG.md | ||
draft: true | ||
prerelease: false | ||
|
||
create-build: | ||
name: Create ${{ matrix.target }} build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
target: [macOS, Windows, Linux, Android] | ||
include: | ||
- os: macos-10.15 # Catalina | ||
target: macOS | ||
build_target: macos | ||
build_path: build/macos/Build/Products/Release | ||
asset_extension: .zip | ||
asset_content_type: application/zip | ||
- os: windows-2019 | ||
target: Windows | ||
build_target: windows | ||
build_path: build\windows\runner\Release | ||
asset_extension: .zip | ||
asset_content_type: application/zip | ||
- os: ubuntu-20.04 | ||
target: Linux | ||
build_target: linux | ||
build_path: build/linux/x64/release/bundle | ||
asset_extension: .tar.gz | ||
asset_content_type: application/gzip | ||
- os: ubuntu-20.04 | ||
target: Android | ||
build_target: apk | ||
build_path: build/app/outputs/flutter-apk | ||
asset_extension: .apk | ||
asset_content_type: application/vnd.android.package-archive | ||
# Disable fail-fast as we want results from all even if one fails. | ||
fail-fast: false | ||
needs: draft-release | ||
steps: | ||
# Set up Flutter. | ||
- name: Clone Flutter repository with master channel | ||
uses: subosito/flutter-action@4389e6cbc6cb8a4b18c628ff96ff90be0e926aa8 | ||
with: | ||
channel: master | ||
|
||
- name: Install Linux dependencies | ||
if: matrix.target == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev | ||
- name: Install Android dependencies | ||
if: matrix.target == 'Android' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: "12.x" | ||
- name: Enable desktop support | ||
if: matrix.target != 'Android' | ||
run: | | ||
flutter config --enable-linux-desktop | ||
flutter config --enable-macos-desktop | ||
flutter config --enable-windows-desktop | ||
- run: flutter doctor -v | ||
# Checkout gallery code, recreate missing files, and get packages. | ||
- name: Checkout gallery code | ||
uses: actions/checkout@v2 | ||
- run: flutter create . | ||
- run: flutter pub get | ||
|
||
- name: Configure Keystore for Android | ||
if: matrix.target == 'Android' | ||
run: | | ||
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks | ||
echo "storeFile=upload-keystore.jks" >> key.properties | ||
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties | ||
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties | ||
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties | ||
env: | ||
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} | ||
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | ||
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | ||
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | ||
working-directory: android | ||
|
||
# Build the application. | ||
- run: flutter build -v ${{ matrix.build_target }} --release | ||
|
||
# Package the build. | ||
- name: Copy VC redistributables to release directory for Windows | ||
if: matrix.target == 'Windows' | ||
run: | | ||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') . | ||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') . | ||
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') . | ||
- name: Rename build for Android | ||
if: matrix.target == 'Android' | ||
run: mv app-release.apk $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.apk | ||
working-directory: ${{ matrix.build_path }} | ||
- name: Compress build for Linux | ||
if: matrix.target == 'Linux' | ||
run: tar czf $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.tar.gz * | ||
working-directory: ${{ matrix.build_path }} | ||
- name: Compress build for macOS | ||
if: matrix.target == 'macOS' | ||
run: ditto -c -k --sequesterRsrc --keepParent Flutter\ Gallery.app $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.zip | ||
working-directory: ${{ matrix.build_path }} | ||
- name: Compress build for Windows | ||
if: matrix.target == 'Windows' | ||
run: compress-archive -Path * -DestinationPath ${env:GITHUB_WORKSPACE}\flutter_gallery_${{ matrix.target }}.zip | ||
working-directory: ${{ matrix.build_path }} | ||
|
||
# Upload the build. | ||
- name: Add packaged build to release draft | ||
id: upload_release_asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.draft-release.outputs.upload_url }} | ||
asset_path: ./flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }} | ||
asset_name: flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }} | ||
asset_content_type: ${{ matrix.asset_content_type }} |
Oops, something went wrong.