-
Notifications
You must be signed in to change notification settings - Fork 2
feat!: initial implementation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0300c73
feat: initial implementation
ItsChaceD c171dd6
fix: use chunked mode for multipart uploads to prevent content length…
ItsChaceD c714ce4
refactor:accurate byte tracking, non-blocking IO, and proper multipar…
ItsChaceD c5ecc37
move connection to helper class
ItsChaceD 1e69579
refactor: split up methods
ItsChaceD 3bdf1ab
refactor: Reorder code and avoid duplication
OS-pedrogustavobilro fe39975
fix: Remove withContext inside flow block
OS-pedrogustavobilro bc4c9c2
fix: Support gzip encoding
OS-pedrogustavobilro 0b0908e
fix: support content:// URIs in upload
OS-pedrogustavobilro b31714e
refactor: cleanup connection code and forced assertions
ItsChaceD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,35 @@ | ||
| name: Publish Native Android Library | ||
|
|
||
| on: workflow_dispatch | ||
|
|
||
| jobs: | ||
| publish-android: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'adopt' | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x ./gradlew | ||
| - name: Grant execute permission for publishing script | ||
| run: chmod +x ./scripts/publish-android.sh | ||
| - name: Make local props | ||
| run: | | ||
| cat << EOF > "local.properties" | ||
| ossrhUsername=${{ secrets.ANDROID_OSSRH_USERNAME }} | ||
| ossrhPassword=${{ secrets.ANDROID_OSSRH_PASSWORD }} | ||
| sonatypeStagingProfileId=${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }} | ||
| signing.keyId=${{ secrets.ANDROID_SIGNING_KEY_ID }} | ||
| signing.password=${{ secrets.ANDROID_SIGNING_PASSWORD }} | ||
| signing.key=${{ secrets.ANDROID_SIGNING_KEY }} | ||
| EOF | ||
| echo "local.properties file has been created successfully." | ||
| - name: Run publish script | ||
| working-directory: ./scripts | ||
| run: ./publish-android.sh |
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or 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,2 +1,2 @@ | ||
| json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one | ||
| package_name("io.ionic.libs.ionfiletransferlib.ion-android") # e.g. com.krausefx.app | ||
| package_name("io.ionic.libs.ionfiletransferlib") # e.g. com.krausefx.app |
This file contains hidden or 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,6 +1,6 @@ | ||
| #Fri Apr 08 08:58:08 WEST 2022 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip | ||
ItsChaceD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| distributionPath=wrapper/dists | ||
| zipStorePath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
This file contains hidden or 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,10 @@ | ||
| <?xml version="1.0" encoding="iso-8859-1"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | ||
| http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
|
||
| <modelVersion>4.0.0</modelVersion> | ||
| <groupId>io.ionic.libs</groupId> | ||
| <artifactId>ionfiletransfer-android</artifactId> | ||
| <version>0.0.1</version> | ||
| </project> |
This file contains hidden or 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 hidden or 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,38 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ANDROID_PATH=../ | ||
| LOG_OUTPUT=./tmp/publish-android.txt | ||
| THE_VERSION=`sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' ../pom.xml` | ||
|
|
||
| # Get latest io.ionic:portals XML version info | ||
| PUBLISHED_URL="https://repo1.maven.org/maven2/io/ionic/libs/ionfiletransfer-android/maven-metadata.xml" | ||
| PUBLISHED_DATA=$(curl -s $PUBLISHED_URL) | ||
| PUBLISHED_VERSION="$(perl -ne 'print and last if s/.*<latest>(.*)<\/latest>.*/\1/;' <<< $PUBLISHED_DATA)" | ||
|
|
||
| if [[ "$THE_VERSION" == "$PUBLISHED_VERSION" ]]; then | ||
| printf %"s\n\n" "Duplicate: a published version exists for $THE_VERSION, skipping..." | ||
| else | ||
| # Make log dir if doesnt exist | ||
| mkdir -p ./tmp | ||
|
|
||
| # Export ENV variable used by Gradle for Versioning | ||
| export THE_VERSION | ||
| export SHOULD_PUBLISH=true | ||
|
|
||
| printf %"s\n" "Attempting to build and publish version $THE_VERSION" | ||
| # Publish a release to the Maven repo | ||
| "$ANDROID_PATH"/gradlew clean build publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository --no-daemon --max-workers 1 -b "$ANDROID_PATH"/build.gradle -Pandroid.useAndroidX=true > $LOG_OUTPUT 2>&1 | ||
| # Stage a version | ||
| # "$ANDROID_PATH"/gradlew clean build publishReleasePublicationToSonatypeRepository --no-daemon --max-workers 1 -b "$ANDROID_PATH"/build.gradle -Pandroid.useAndroidX=true > $LOG_OUTPUT 2>&1 | ||
|
|
||
| echo $RESULT | ||
|
|
||
| if grep --quiet "BUILD SUCCESSFUL" $LOG_OUTPUT; then | ||
| printf %"s\n" "Success: Published to MavenCentral." | ||
| else | ||
| printf %"s\n" "Error publishing, check $LOG_OUTPUT for more info! Manually review and release from the Sonatype Repository Manager may be necessary https://s01.oss.sonatype.org/" | ||
| cat $LOG_OUTPUT | ||
| exit 1 | ||
| fi | ||
|
|
||
| fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.