This repository has been archived by the owner on Feb 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
168 additions
and
176 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 |
---|---|---|
|
@@ -2,19 +2,7 @@ name: Build | |
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/build.yml' | ||
- 'app/**' | ||
- 'gradle/**' | ||
- '*.gradle' | ||
- '*.properties' | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
description: 'Release' | ||
type: boolean | ||
required: true | ||
default: false | ||
|
||
jobs: | ||
build: | ||
|
@@ -33,77 +21,32 @@ jobs: | |
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Set environments | ||
run: | | ||
{ | ||
echo "version=v$(grep versionName app/build.gradle | awk '{print $2}' | tr -d \")" | ||
echo "version=v$(grep versionName app/build.gradle | awk -F\" '{print $2}')" | ||
echo "commit=$(echo ${{ github.sha }} | cut -c-7)" | ||
echo "repo=$(echo ${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/})" | ||
} >> $GITHUB_ENV | ||
- name: Check tag exists | ||
uses: mukunku/[email protected] | ||
if: github.event.inputs.release == 'true' | ||
id: check-tag | ||
with: | ||
tag: "${{ env.version }}" | ||
|
||
- name: Release check | ||
if: github.event.inputs.release == 'true' | ||
run: | | ||
if [ "${{ secrets.STORE_FILE }}" == "" ]; then | ||
echo -e "\nERROR!\nTo release, you need to set up a signing key!\n" | ||
echo "STORE_FILE: A Base64 encoded string of the signing key in JKS format" | ||
echo "STORE_PASSWORD: Key store password" | ||
echo "KEY_ALIAS: Key alias" | ||
echo "KEY_PASSWORD: Key password" | ||
echo "" | ||
exit 1 | ||
fi | ||
if [ "${{ steps.check-tag.outputs.exists }}" == "true" ]; then | ||
echo -e "\nERROR!\nThe same tag already exists!\n" | ||
echo "Please change versionName in build.gradle" | ||
echo "" | ||
exit 1 | ||
fi | ||
- name: Build with Gradle | ||
- name: Build | ||
run: | | ||
if [ "${{ inputs.release }}" == "true" ]; then | ||
echo "${{ secrets.STORE_FILE }}" | base64 -d > app/release.jks | ||
export STORE_PASSWORD="${{ secrets.STORE_PASSWORD }}" | ||
export KEY_ALIAS="${{ secrets.KEY_ALIAS }}" | ||
export KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" | ||
./gradlew assembleRelease bundleRelease | ||
cp -f app/build/outputs/apk/release/app-release.apk ${{ env.repo }}-${{ env.version }}.apk | ||
cp -f app/build/outputs/bundle/release/app-release.aab ${{ env.repo }}-${{ env.version }}.aab | ||
else | ||
./gradlew assembleDebug bundleDebug | ||
cp -f app/build/outputs/apk/debug/app-debug.apk ${{ env.repo }}-${{ env.version }}@${{ env.commit }}.apk | ||
cp -f app/build/outputs/bundle/debug/app-debug.aab ${{ env.repo }}-${{ env.version }}@${{ env.commit }}.aab | ||
fi | ||
./gradlew assembleDebug bundleDebug --no-daemon --stacktrace --warning-mode=all | ||
cp -f app/build/outputs/apk/debug/app-debug.apk ${{ env.repo }}-${{ env.version }}@${{ env.commit }}.apk | ||
cp -f app/build/outputs/bundle/debug/app-debug.aab ${{ env.repo }}-${{ env.version }}@${{ env.commit }}.aab | ||
- name: Attest | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: ${{ env.repo }}-${{ env.version }}*.a* | ||
|
||
- name: Upload APK | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.repo }}(${{ env.version }}@${{ env.commit }}) | ||
path: ${{ env.repo }}-${{ env.version }}*.a* | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: github.event.inputs.release == 'true' | ||
with: | ||
tag_name: ${{ env.version }} | ||
draft: true | ||
prerelease: false | ||
files: ${{ env.repo }}-${{ env.version }}.apk |
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ build/ | |
# Android Studio Signing APK | ||
/app/debug/ | ||
/app/release/ | ||
# VS Code | ||
/.vscode/ |
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
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,3 +1,2 @@ | ||
-ignorewarnings | ||
-keepattributes LineNumberTable,SourceFile | ||
-renamesourcefileattribute SourceFile |
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,23 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:sharedUserId="me.s1204.benesse.shared"> | ||
|
||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" | ||
tools:ignore="ProtectedPermissions" /> | ||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> | ||
|
||
<application | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="BenesseExtension Tester"> | ||
<activity | ||
android:name=".Tester" | ||
android:exported="true"> | ||
android:exported="true" | ||
android:screenOrientation="landscape"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
</application> | ||
|
||
</manifest> |
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,36 @@ | ||
/* | ||
* Copyright (C) 2013 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package androidx.annotation; | ||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | ||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PACKAGE; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.CLASS; | ||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
/** | ||
* Denotes that a parameter, field or method return value can never be null. | ||
* <p> | ||
* This is a marker annotation and it has no specific attributes. | ||
*/ | ||
@Documented | ||
@Retention(CLASS) | ||
@Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE}) | ||
public @interface NonNull { | ||
} |
Oops, something went wrong.