Skip to content

Commit

Permalink
build: try build in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Jul 23, 2024
1 parent b6164dd commit dbf01a8
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 114 deletions.
70 changes: 12 additions & 58 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,63 +290,17 @@ runs:
fi
echo "GPG_PASSPHRASE=***" >> $GITHUB_ENV
echo "GRADLE_TASK=$GRADLE_TASK" >> $GITHUB_ENV
echo "MAVEN_PHASE=$MAVEN_PHASE" >> $GITHUB_ENV
echo "MAVEN_OPTIONS=$MAVEN_OPTIONS" >> $GITHUB_ENV
- name: Build project
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
gradle-home-cache-cleanup: true
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
add-job-summary-as-pr-comment: on-failure

- name: Build with Gradle
shell: bash
run: |
git --version
$PREFIX-gcc --version
cmake --version
gradle --version
mvn -version
gpg --version
python3 --version
ccache -s --version
df -h
export MAKEJ=$(getconf _NPROCESSORS_ONLN)
echo Fetching $GITHUB_REPOSITORY@$GITHUB_SHA
git config --global --add safe.directory '*'
git init
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY $GITHUB_SHA
git checkout $GITHUB_SHA
git submodule update --init --recursive
git submodule foreach --recursive 'git reset --hard'
if [[ -n ${CI_DEPLOY_NEED_GRADLE:-} ]]; then
echo Executing Gradle $GRADLE_TASK ${{ matrix.options }} $CI_DEPLOY_OPTIONS on $MAKEJ processors
export GRADLE_OPTIONS="-Dorg.gradle.jvmargs=-Xmx2048m -PjavacppPlatform=$CI_DEPLOY_PLATFORM -PjavacppPlatformExtension=${{ matrix.ext }} ${{ matrix.options }} $CI_DEPLOY_OPTIONS --info"
gradle clean build $GRADLE_OPTIONS -b $CI_DEPLOY_MODULE/build.gradle
echo Publishing only now to help avoid race conditions with Gradle
gradle $GRADLE_TASK $GRADLE_OPTIONS -b $CI_DEPLOY_MODULE/build.gradle --refresh-dependencies
else
mkdir -p $HOME/.m2
echo "<settings>" > $HOME/.m2/settings.xml
echo "<mirrors><mirror><id>google-maven-central</id><name>GCS Maven Central mirror</name><url>https://maven-central.storage-download.googleapis.com/maven2/</url><mirrorOf>central</mirrorOf></mirror></mirrors>" >> $HOME/.m2/settings.xml
echo "<servers><server><id>sonatype-nexus-snapshots</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server><server><id>sonatype-nexus-staging</id><username>$CI_DEPLOY_USERNAME</username><password>$CI_DEPLOY_PASSWORD</password></server></servers>" >> $HOME/.m2/settings.xml
echo "</settings>" >> $HOME/.m2/settings.xml
SECONDS=$(( RANDOM % 300 ))
echo Sleeping $SECONDS seconds to help avoid race conditions with Maven
sleep $SECONDS
echo Executing Maven $MAVEN_PHASE $CI_DEPLOY_OPTIONS on $MAKEJ processors
export EXT=${{ matrix.ext }}
export EXT2=${EXT:1}
export MAVEN_OPTS="-Xss2m -Xmx4g"
export MAVEN_OPTIONS="clean $MAVEN_PHASE clean -B -U -e -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3 -Djavacpp.platform=$CI_DEPLOY_PLATFORM -Djavacpp.platform.extension=$EXT $MAVEN_OPTIONS $CI_DEPLOY_OPTIONS"
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -pl .,$CI_DEPLOY_MODULE && break || STATUS=$? && sleep 60; done; (exit $STATUS)
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE/platform/$EXT2/pom.xml && break || STATUS=$? && sleep 60; done; (exit $STATUS)
if [[ -e $CI_DEPLOY_MODULE/platform/redist/pom.xml ]]; then
for i in {1..5}; do STATUS=0; mvn $MAVEN_OPTIONS -f $CI_DEPLOY_MODULE/platform/redist/pom.xml && break || STATUS=$? && sleep 60; done; (exit $STATUS)
fi
fi
df -h
- name: Clean up
shell: bash
run: |
cd $HOME
rm -Rf $(find .m2/repository/ -name '*SNAPSHOT*')
run: ./gradlew build publish -Pnative.extension=${{ matrix.ext }} --console=plain --info --build-cache --configure-on-demand --configuration-cache --parallel
110 changes: 56 additions & 54 deletions .github/workflows/ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }}
permissions:
contents: write
jobs:
# android-arm:
# runs-on: ubuntu-20.04
Expand All @@ -25,48 +27,48 @@ jobs:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
android-arm64:
runs-on: ubuntu-20.04
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# android-arm64:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# android-x86:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
android-x86_64:
runs-on: ubuntu-20.04
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# android-x86_64:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-armhf:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
linux-arm64:
runs-on: ubuntu-20.04
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
linux-ppc64le:
runs-on: ubuntu-20.04
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-arm64:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-ppc64le:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
# linux-x86:
# runs-on: ubuntu-20.04
# strategy:
Expand All @@ -81,37 +83,37 @@ jobs:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
macosx-arm64:
runs-on: macos-12
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
macosx-x86_64:
runs-on: macos-12
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
# macosx-arm64:
# runs-on: macos-12
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
# macosx-x86_64:
# runs-on: macos-12
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
# windows-x86:
# runs-on: windows-2019
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
windows-x86_64:
runs-on: windows-2019
strategy:
matrix:
ext: ["", -gpl]
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
redeploy:
# windows-x86_64:
# runs-on: windows-2019
# strategy:
# matrix:
# ext: ["", -gpl]
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
# redeploy:
# needs: [android-arm, android-arm64, android-x86, android-x86_64, linux-armhf, linux-arm64, linux-ppc64le, linux-x86, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86, windows-x86_64]
needs: [android-arm64, android-x86_64, linux-arm64, linux-ppc64le, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64]
runs-on: ubuntu-20.04
steps:
- uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions
# needs: [android-arm64, android-x86_64, linux-arm64, linux-ppc64le, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64]
# runs-on: ubuntu-20.04
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ val compileNative by tasks.registering(Exec::class) {
commandLine(
"bash",
layout.projectDirectory.file("cppbuild.sh").asFile.absolutePath,
// "-extension", "-gpl", // TODO: Enable later
"-extension", findProperty("native.extension") as String? ?: "",
"install",
)
workingDir(layout.projectDirectory.asFile)
Expand All @@ -41,6 +41,7 @@ val compileNative by tasks.registering(Exec::class) {
outputs.dir(layout.projectDirectory.dir("ffmpeg/cppbuild/${platform}/include"))
outputs.dir(layout.projectDirectory.dir("ffmpeg/cppbuild/${platform}/lib"))
outputs.dir(layout.projectDirectory.dir("ffmpeg/cppbuild/${platform}/share"))
outputs.cacheIf { true }
}

tasks.build {
Expand All @@ -66,7 +67,7 @@ publishing {
}

repositories {
maven(System.getenv("REPOSILITE_URL") ?: "https://reposilite.silenium.dev/private") {
maven(System.getenv("REPOSILITE_URL") ?: "https://reposilite.silenium.dev/snapshots") {
name = "reposilite"
credentials {
username =
Expand Down

0 comments on commit dbf01a8

Please sign in to comment.