Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into publish-elmslie-3.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	detekt/detekt.yml
#	elmslie-coroutines/src/main/java/vivid/money/elmslie/coroutines/ElmStoreCompat.kt
#	elmslie-samples/compose-paging/src/main/java/vivid/money/elmslie/samples/android/compose/view/PagingScreen.kt
#	gradle.properties
#	gradle/android-library.gradle
#	gradle/dependencies.gradle
#	gradle/wrapper/gradle-wrapper.properties
  • Loading branch information
Dmitriy Berdnikov committed Jun 19, 2024
2 parents 11c418e + 59432b2 commit d68a845
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/sh/validate_publishing_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
if [[ ${GITHUB_REF##*/} == main ]]; then
# Safe to publish from main branch
exit 0
elif [[ ${GITHUB_REF##*/} == publish* ]]; then
elif [[ ${GITHUB_REF##*/} == release* ]]; then
# Safe to publish from branches that have manually enabled publishing
exit 0
else
echo "::error ::Can only release from main branch or branches that start with 'publish'"
echo "::error ::Can only release from main branch or branches that start with 'release'"
exit 1
fi
48 changes: 48 additions & 0 deletions .github/workflows/publish-to-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish to Maven Central

on: workflow_dispatch

env:
NEW_VERSION: ${{ github.event.inputs.version }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}

jobs:
validate:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Ensure main branch
run: ./.github/sh/validate_publishing_branch.sh

- name: Validate publishing
run: |
./gradlew \
-xtest \
-xlint \
publishToMavenLocal
- name: Publishing
run: ./gradlew publishToMavenCentral
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down

0 comments on commit d68a845

Please sign in to comment.