Skip to content

Commit

Permalink
Merge pull request #3 from soralis0912/master
Browse files Browse the repository at this point in the history
ビルドの自動化
  • Loading branch information
Chipppppppppp authored Jan 20, 2024
2 parents db31617 + 13b3138 commit e4f28f8
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
workflow_dispatch:
branches-ignore:
- '**'
tags:
- 'v*'
create:
branches-ignore:
- '**'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Gradle
run: |
if [[ -n "${{ secrets.KEYSTORE_BASE64 }}" ]]; then
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > release.keystore
export KEYSTORE_PASSWORD="${{ secrets.KEYSTORE_PASSWORD }}"
export KEY_ALIAS="${{ secrets.KEY_ALIAS }}"
export KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}"
fi
./gradlew assembleRelease
- name: Get apk path
id: apk-path
run: |
path=$(find **/build/outputs/apk -name '*.apk' -type f | head -1)
echo "::set-output name=path::$path"
- name: Upload apk file
uses: actions/upload-artifact@v1
with:
name: apk
path: ${{ steps.apk-path.outputs.path }}
- name: Upload Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: ${{ steps.apk-path.outputs.path }}
token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 14 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ android {

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
debug {
storeFile rootProject.file('debug.keystore')
}
release {
storeFile rootProject.file('release.keystore')
storePassword System.getenv('KEYSTORE_PASSWORD')
keyAlias System.getenv('KEY_ALIAS')
keyPassword System.getenv('KEY_PASSWORD')
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
if (rootProject.file('release.keystore').exists()) {
signingConfig signingConfigs.release
}
}
}
compileOptions {
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit e4f28f8

Please sign in to comment.