jellyfin-sdk-kotlin/.github/workflows/sdk-publish.yaml
2024-10-27 16:17:56 +01:00

48 lines
1.9 KiB
YAML

name: SDK / Publish
on:
push:
tags:
- v*
branches:
- master
- openapi-unstable
jobs:
publish:
name: Publish
runs-on: ubuntu-24.04
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.repository_owner, 'jellyfin') }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Set JELLYFIN_VERSION
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: echo "JELLYFIN_VERSION=$(echo ${GITHUB_REF#refs/tags/v} | tr / -)" >> $GITHUB_ENV
- name: Set JELLYFIN_BRANCH
if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: echo "JELLYFIN_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Run publish task
run: ./gradlew publish closeAndReleaseSonatypeStagingRepository
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Run build and assembleDist tasks
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: ./gradlew build assembleDist -x check
- name: Upload release assets
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: alexellis/upload-assets@13926a61cdb2cb35f5fdef1c06b8b591523236d3 # 0.4.1
with:
asset_paths: '["**/distributions/*-${{ env.JELLYFIN_VERSION }}.zip", "**/libs/*-${{ env.JELLYFIN_VERSION }}.jar", "**/outputs/aar/*.aar"]'
env:
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}