-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): split release workflows (#106)
- Loading branch information
1 parent
869fa92
commit e6604cb
Showing
2 changed files
with
78 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,41 +1,16 @@ | ||
name: Release | ||
name: Release Android | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version to release, 0.5.1 (without 'v')" | ||
required: true | ||
|
||
jobs: | ||
ios: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.API_GITHUB_TOKEN }} | ||
|
||
- name: Setup environment | ||
id: setup | ||
run: | | ||
git clone https://github.com/flutter/flutter.git -b stable --depth=1 | ||
flutter/bin/flutter doctor | ||
echo ::set-output name=tag::${GITHUB_REF##*/} | ||
- name: Build | ||
run: | | ||
flutter/bin/flutter build ios --no-codesign --release | ||
cd build/ios/ | ||
mv iphoneos Payload | ||
zip -r WiiMoteDSU-${{ steps.setup.outputs.tag }}.ipa Payload | ||
- name: Upload assets | ||
uses: AButler/[email protected] | ||
with: | ||
files: build/ios/WiiMoteDSU-${{ steps.setup.outputs.tag }}.ipa | ||
release-tag: ${{ steps.setup.outputs.tag }} | ||
repo-token: ${{ secrets.API_GITHUB_TOKEN }} | ||
|
||
android: | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -49,6 +24,8 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.API_GITHUB_TOKEN }} | ||
# default is '', i.e. commit that triggered this event | ||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' && format('refs/tags/v{0}', github.event.inputs.version) || ''}} | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
|
@@ -65,9 +42,19 @@ jobs: | |
id: setup | ||
run: | | ||
flutter pub get | ||
- name: Setup version and tag from commit | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | ||
echo "version=${GITHUB_REF##*/v}" >> $GITHUB_OUTPUT | ||
- name: Setup version and tag from workflow_dispatch | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' | ||
run: | | ||
echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
- name: Set Version | ||
run: sed -i 's/1337.42.1337+42/${{ steps.setup.outputs.version }}+${{ github.run_number }}/g' pubspec.yaml | ||
|
||
|
@@ -91,7 +78,7 @@ jobs: | |
flutter build appbundle --release | ||
cd build/app/outputs/flutter-apk/ | ||
mv app-release.apk WiiMoteDSU-${{ steps.setup.outputs.tag }}.apk | ||
cd ../release/app-release.aab | ||
cd ../release/ | ||
mv app-release.aab WiiMoteDSU-${{ steps.setup.outputs.tag }}.aab | ||
- name: Upload assets | ||
|
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,59 @@ | ||
name: Release iOS | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version to release, 0.5.1 (without 'v')" | ||
required: true | ||
|
||
jobs: | ||
ios: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.API_GITHUB_TOKEN }} | ||
# default is '', i.e. commit that triggered this event | ||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' && format('refs/tags/v{0}', github.event.inputs.version) || ''}} | ||
|
||
- name: Setup environment | ||
id: setup | ||
run: | | ||
git clone https://github.com/flutter/flutter.git -b stable --depth=1 | ||
flutter/bin/flutter doctor | ||
- name: Deps | ||
id: deps | ||
run: flutter pub get | ||
|
||
- name: Setup version and tag from commit | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | ||
echo "version=${GITHUB_REF##*/v}" >> $GITHUB_OUTPUT | ||
- name: Setup version and tag from workflow_dispatch | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' | ||
run: | | ||
echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
- name: Build | ||
run: | | ||
flutter/bin/flutter build ios --no-codesign --release | ||
cd build/ios/ | ||
mv iphoneos Payload | ||
zip -r WiiMoteDSU-${{ steps.setup.outputs.tag }}.ipa Payload | ||
- name: Upload assets | ||
uses: AButler/[email protected] | ||
with: | ||
files: build/ios/WiiMoteDSU-${{ steps.setup.outputs.tag }}.ipa | ||
release-tag: ${{ steps.setup.outputs.tag }} | ||
repo-token: ${{ secrets.API_GITHUB_TOKEN }} |