Skip to content

Commit

Permalink
ci: extract kotlin build, migrate to ubuntu 20 04
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Jul 27, 2024
1 parent 73db1b5 commit 0a728a0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 45 deletions.
37 changes: 37 additions & 0 deletions .github/actions/deploy-kotlin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Kotlin artifacts
description: "Publish Kotlin artifacts"
inputs:
gradle-cache-encryption-key:
description: 'The encryption key for the Gradle cache.'
required: false
runs:
using: composite
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ inputs.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: Publish release
shell: bash
if: "github.event_name == 'release'"
run: ./gradlew build publish -Pdeploy.native=false -Pdeploy.kotlin=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ github.event.release.tag_name }} --console=plain --info --configure-on-demand --parallel --build-cache

- name: Set outputs
id: vars
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Publish snapshot
shell: bash
if: "github.event_name != 'release'"
run: ./gradlew build publish -Pdeploy.native=false -Pdeploy.kotlin=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ steps.vars.outputs.sha_short }}-dev --console=plain --info --configure-on-demand --parallel --build-cache
10 changes: 1 addition & 9 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name: Deploy on Ubuntu
description: "Deploy on Ubuntu"
inputs:
gradle-cache-encryption-key:
description: 'The encryption key for the Gradle cache.'
required: false
reposilite-username:
description: 'The username for the Reposilite repository.'
required: false
reposilite-password:
description: 'The password for the Reposilite repository.'
required: false
reposilite-url:
description: 'The URL for the Reposilite repository.'
required: false
runs:
using: composite
steps:
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@ permissions:
contents: write
jobs:
# android-arm:
# runs-on: ubuntu-22.04
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# gpl: ["false", "true"]
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/deploy-ubuntu
# android-arm64:
# runs-on: ubuntu-22.04
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# gpl: ["false", "true"]
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/deploy-ubuntu
# android-x86:
# runs-on: ubuntu-22.04
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# gpl: ["false", "true"]
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/deploy-ubuntu
# android-x86_64:
# runs-on: ubuntu-22.04
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# gpl: ["false", "true"]
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/deploy-ubuntu
linux-arm:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
gpl: ["false", "true"]
Expand All @@ -68,7 +68,7 @@ jobs:
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
linux-arm64:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
gpl: ["false", "true"]
Expand All @@ -79,7 +79,7 @@ jobs:
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
linux-ppc64le:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
gpl: ["false", "true"]
Expand All @@ -90,7 +90,7 @@ jobs:
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
linux-x86:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
gpl: ["false", "true"]
Expand All @@ -101,7 +101,7 @@ jobs:
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
linux-x86_64:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
gpl: ["false", "true"]
Expand Down Expand Up @@ -146,38 +146,15 @@ jobs:
# redeploy:
# needs: [android-arm, android-arm64, android-x86, android-x86_64, linux-arm, 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-22.04
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/redeploy
deploy-kotlin:
name: Publish Kotlin artifacts
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
- uses: ./.github/actions/deploy-kotlin
with:
distribution: 'temurin'
java-version: '11'
- 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: Publish release
shell: bash
if: "github.event_name == 'release'"
run: ./gradlew build publish -Pdeploy.native=false -Pdeploy.kotlin=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ github.event.release.tag_name }} --console=plain --info --configure-on-demand --parallel --build-cache

- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Publish snapshot
shell: bash
if: "github.event_name != 'release'"
run: ./gradlew build publish -Pdeploy.native=false -Pdeploy.kotlin=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ steps.vars.outputs.sha_short }}-dev --console=plain --info --configure-on-demand --parallel --build-cache
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}

0 comments on commit 0a728a0

Please sign in to comment.