Skip to content

Commit 320ea94

Browse files
committed
apkとiosのテスト
1 parent e8d2d44 commit 320ea94

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

.github/workflows/apk_deploy.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: デプロイ(apk)
2+
3+
on: [workflow_dispatch]
4+
5+
permissions:
6+
contents: write
7+
8+
9+
jobs:
10+
build_for_android:
11+
name: Android用ビルド
12+
runs-on: macos-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Get Flutter version from .fvmrc
18+
run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $GITHUB_ENV
19+
20+
- name: Install flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
24+
cache: true
25+
26+
- uses: actions/setup-java@v4
27+
with:
28+
distribution: 'zulu'
29+
java-version: '17'
30+
cache: 'gradle'
31+
32+
33+
- name: Cache pubspec dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
${{ env.FLUTTER_HOME }}/.pub-cache
38+
**/.packages
39+
**/.flutter-plugins
40+
**/.flutter-plugin-dependencies
41+
**/.dart_tool/package_config.json
42+
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
43+
restore-keys: |
44+
build-pubspec-
45+
46+
- name: Create symbolic link
47+
run: ln -s ${{ env.FLUTTER_ROOT }} $HOME/work/flutter
48+
49+
- name: Flutter pub get
50+
run: flutter pub get
51+
52+
- name: Get version
53+
run: |
54+
echo "BUMP_VERSION=$(flutter pub run cider version)" >> $GITHUB_ENV
55+
56+
- name: Create apk file
57+
run: |
58+
echo -n "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode --output ./android/release.keystore
59+
export ANDROID_KEYSTORE_PASSWORD="${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
60+
export ANDROID_KEY_ALIAS="${{ secrets.ANDROID_KEY_ALIAS }}"
61+
export ANDROID_KEY_PASSWORD="${{ secrets.ANDROID_KEY_PASSWORD }}"
62+
flutter build apk --no-tree-shake-icons --release
63+
mv ./build/app/outputs/flutter-apk/app-release.apk ./build/app/outputs/flutter-apk/miria-$BUMP_VERSION.apk
64+
65+
- name: Create tag and release note
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
run: |
69+
gh release upload v$BUMP_VERSION --clobber ./build/app/outputs/flutter-apk/miria-$BUMP_VERSION.apk

.github/workflows/build_test_ios.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: テストビルド(iOS)
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build_for_iOS:
7+
name: iOS用テストビルド
8+
runs-on: macos-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install flutter
14+
uses: subosito/flutter-action@v2
15+
with:
16+
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
17+
cache: true
18+
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: 'zulu'
22+
java-version: '17'
23+
cache: 'gradle'
24+
25+
26+
- name: Cache pubspec dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
${{ env.FLUTTER_HOME }}/.pub-cache
31+
**/.packages
32+
**/.flutter-plugins
33+
**/.flutter-plugin-dependencies
34+
**/.dart_tool/package_config.json
35+
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
36+
restore-keys: |
37+
build-pubspec-
38+
39+
- name: Create symbolic link
40+
run: ln -s ${{ env.FLUTTER_ROOT }} $HOME/work/flutter
41+
42+
- name: Flutter pub get
43+
run: flutter pub get
44+
45+
- name: Run flutter test with coverage
46+
run: flutter test --coverage --coverage-path=~/coverage/lcov.info
47+
48+
- name: Create archive file
49+
run: flutter build ipa --no-tree-shake-icons --release --no-codesign

0 commit comments

Comments
 (0)