Skip to content

Commit

Permalink
deploy.ymlの修正とlinux_deploy.ymlへの分離
Browse files Browse the repository at this point in the history
  • Loading branch information
Npepperlinux committed Sep 14, 2023
1 parent 0c7150b commit def73d0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 55 deletions.
70 changes: 15 additions & 55 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
build_for_iOS:
name: iOS用ビルド
name: iOS・Android用ビルド
runs-on: macos-latest

steps:
Expand Down Expand Up @@ -89,57 +89,17 @@ jobs:
bundle install
fastlane release
build_apk_appimage:
name: Android・Linux用ビルド
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: Flutter pub get
run: flutter pub get

- name: Initialize git config
run: |
git config --local user.name $GIT_USER_NAME
git config --local user.email $GIT_USER_EMAIL
- name: Get Version
run: export "VERSION=$BUMP_VERSION"

- name: Create apk file
run: |
echo -n "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode --output ./android/release.keystore
export ANDROID_KEYSTORE_PASSWORD="${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
export ANDROID_KEY_ALIAS="${{ secrets.ANDROID_KEY_ALIAS }}"
export ANDROID_KEY_PASSWORD="${{ secrets.ANDROID_KEY_PASSWORD }}"
flutter build apk --no-tree-shake-icons --release
mv ./build/app/outputs/flutter-apk/app-release.apk ./build/app/outputs/flutter-apk/miria-$VERSION.apk
- name: Create AppImage file
run: |
sudo apt install libsecret-1-dev clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev locate libfuse2
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
flutter pub global activate flutter_distributor
flutter_distributor package --platform linux --targets appimage
mv ./dist/$VERSION/miria-$VERSION-linux.AppImage ./dist/$VERSION/miria-$VERSION-amd64.AppImage
- name: Create tag and release note
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v$VERSION --generate-notes --draft ./build/app/outputs/flutter-apk/miria-$VERSION.apk ./dist/$VERSION/miria-$VERSION-amd64.AppImage
- name: Create apk file
run: |
echo -n "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode --output ./android/release.keystore
export ANDROID_KEYSTORE_PASSWORD="${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
export ANDROID_KEY_ALIAS="${{ secrets.ANDROID_KEY_ALIAS }}"
export ANDROID_KEY_PASSWORD="${{ secrets.ANDROID_KEY_PASSWORD }}"
flutter build apk --no-tree-shake-icons --release
mv ./build/app/outputs/flutter-apk/app-release.apk ./build/app/outputs/flutter-apk/miria-$BUMP_VERSION.apk
- name: Create tag and release note
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v$BUMP_VERSION --generate-notes --draft ./build/app/outputs/flutter-apk/miria-$BUMP_VERSION.apk
47 changes: 47 additions & 0 deletions .github/workflows/linux_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: デプロイ

on:
release:
types: [published]

permissions:
contents: write

jobs:
build_for_linux:
name: Linux用ビルド
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Flutter pub get
run: flutter pub get

- name: Get Version
run: echo "BUMP_VERSION=$(flutter pub run cider version)" >> $GITHUB_ENV

- name: Setup build env
run: |
sudo apt install libsecret-1-dev clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev locate libfuse2
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
flutter pub global activate flutter_distributor
- name: Create AppImage file
run: |
flutter_distributor package --platform linux --targets appimage
mv ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-linux.AppImage ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-amd64.AppImage
- name: Upload AppImage file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v$BUMP_VERSION ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-amd64.AppImage

0 comments on commit def73d0

Please sign in to comment.