Skip to content

Commit dc71eb2

Browse files
committed
ci: extract kotlin build, cleanup env
1 parent 73db1b5 commit dc71eb2

File tree

3 files changed

+52
-42
lines changed

3 files changed

+52
-42
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Kotlin artifacts
2+
description: "Publish Kotlin artifacts"
3+
inputs:
4+
gradle-cache-encryption-key:
5+
description: 'The encryption key for the Gradle cache.'
6+
required: false
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v4
14+
with:
15+
distribution: 'temurin'
16+
java-version: '11'
17+
- name: Setup Gradle
18+
uses: gradle/actions/setup-gradle@v3
19+
with:
20+
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
21+
gradle-home-cache-cleanup: true
22+
build-scan-publish: true
23+
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
24+
build-scan-terms-of-use-agree: "yes"
25+
add-job-summary-as-pr-comment: on-failure
26+
cache-write-only: true
27+
28+
- name: Publish release
29+
shell: bash
30+
if: "github.event_name == 'release'"
31+
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
32+
33+
- name: Set outputs
34+
id: vars
35+
shell: bash
36+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
37+
- name: Publish snapshot
38+
shell: bash
39+
if: "github.event_name != 'release'"
40+
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

.github/actions/deploy-ubuntu/action.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
name: Deploy on Ubuntu
2+
description: "Deploy on Ubuntu"
23
inputs:
34
gradle-cache-encryption-key:
45
description: 'The encryption key for the Gradle cache.'
56
required: false
6-
reposilite-username:
7-
description: 'The username for the Reposilite repository.'
8-
required: false
9-
reposilite-password:
10-
description: 'The password for the Reposilite repository.'
11-
required: false
12-
reposilite-url:
13-
description: 'The URL for the Reposilite repository.'
14-
required: false
157
runs:
168
using: composite
179
steps:
18-
- name: Set outputs
19-
id: vars
20-
shell: bash
21-
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
2210
- name: Install environment
2311
shell: bash
2412
env:
@@ -220,6 +208,11 @@ runs:
220208
$SUDO rm -f $(find /usr/local/cuda/ -name '*.a' -and -not -name libcudart_static.a -and -not -name libcudadevrt.a -and -not -name libnvcomp_device.a)
221209
fi
222210
211+
- name: Set up JDK 11
212+
uses: actions/setup-java@v4
213+
with:
214+
distribution: 'temurin'
215+
java-version: '11'
223216
- name: Setup Gradle
224217
uses: gradle/actions/setup-gradle@v3
225218
with:
@@ -235,6 +228,10 @@ runs:
235228
if: "github.event_name == 'release'"
236229
run: ./gradlew build publish -Pdeploy.kotlin=false -Pdeploy.native=true -Pffmpeg.platform=${{ github.job }} -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ github.event.release.tag_name }} --console=plain --info --configure-on-demand --parallel --build-cache --configuration-cache
237230

231+
- name: Set outputs
232+
id: vars
233+
shell: bash
234+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
238235
- name: Publish snapshot
239236
shell: bash
240237
if: "github.event_name != 'release'"

.github/workflows/ffmpeg.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ env:
1313
CI_DEPLOY_NEED_GCC: 1
1414
CI_DEPLOY_MODULE: ${{ github.workflow }}
1515
CI_DEPLOY_PLATFORM: ${{ github.job }}
16-
CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }}
17-
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
18-
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
19-
STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }}
2016
REPOSILITE_USERNAME: ${{ secrets.REPOSILITE_USERNAME }}
2117
REPOSILITE_PASSWORD: ${{ secrets.REPOSILITE_PASSWORD }}
2218
# deploy to snapshots if not a release
@@ -155,29 +151,6 @@ jobs:
155151
runs-on: ubuntu-22.04
156152
steps:
157153
- uses: actions/checkout@v4
158-
- name: Set up JDK 11
159-
uses: actions/setup-java@v4
154+
- uses: ./.github/actions/deploy-kotlin
160155
with:
161-
distribution: 'temurin'
162-
java-version: '11'
163-
- name: Setup Gradle
164-
uses: gradle/actions/setup-gradle@v3
165-
with:
166-
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
167-
gradle-home-cache-cleanup: true
168-
build-scan-publish: true
169-
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
170-
build-scan-terms-of-use-agree: "yes"
171-
add-job-summary-as-pr-comment: on-failure
172-
- name: Publish release
173-
shell: bash
174-
if: "github.event_name == 'release'"
175-
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
176-
177-
- name: Set outputs
178-
id: vars
179-
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
180-
- name: Publish snapshot
181-
shell: bash
182-
if: "github.event_name != 'release'"
183-
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
156+
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}

0 commit comments

Comments
 (0)