mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Add Plugin-API release step to Release workflow
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
name: Plugin-API Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
|
||||
- name: Decrypt and import GPG key
|
||||
run: |
|
||||
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||
env:
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
|
||||
- name: Build and deploy with JReleaser
|
||||
run: ./gradlew jreleaserFullRelease
|
||||
env:
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
|
||||
MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
|
||||
JRELEASER_GITHUB_TOKEN: ${{ GITHUB_TOKEN }}
|
||||
@@ -13,58 +13,68 @@ on:
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
release:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||
outputs:
|
||||
release_version: ${{ steps.get_version.outputs.release_version }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Needed for git tag
|
||||
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
|
||||
- name: Get version from build.gradle.kts if not provided
|
||||
id: get_version
|
||||
run: |
|
||||
if [ -z "${{ github.event.inputs.version }}" ]; then
|
||||
VERSION=$(grep '^version = ' build.gradle.kts | sed 's/version = "\(.*\)"/\1/')
|
||||
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
else
|
||||
echo "release_version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Update version in build.gradle.kts
|
||||
if: ${{ github.event.inputs.update_version }}
|
||||
run: |
|
||||
sed -i "s/^version = .*/version = \"$RELEASE_VERSION\"/" build.gradle.kts
|
||||
|
||||
- name: Update version in app/package.json
|
||||
if: ${{ github.event.inputs.update_version }}
|
||||
run: |
|
||||
jq ".version = \"$RELEASE_VERSION\"" app/package.json > app/package.json.tmp && mv app/package.json.tmp app/package.json
|
||||
|
||||
docker:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
- name: Run production build
|
||||
env:
|
||||
GAMEYFIN_KEYSTORE_PASSWORD: ${{ secrets.GAMEYFIN_KEYSTORE_PASSWORD }}
|
||||
run: ./gradlew clean build -Pvaadin.productionMode=true
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
@@ -72,30 +82,62 @@ jobs:
|
||||
file: docker/Dockerfile
|
||||
platforms: linux/arm64/v8,linux/amd64
|
||||
push: true
|
||||
tags: grimsi/gameyfin:${{ env.RELEASE_VERSION }}
|
||||
tags: grimsi/gameyfin:${{ needs.setup.outputs.release_version }}
|
||||
|
||||
plugin_api:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
- name: Decrypt and import GPG key
|
||||
run: |
|
||||
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||
env:
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
- name: Build and push Plugin-API
|
||||
run: ./gradlew jreleaserFullRelease
|
||||
env:
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
|
||||
MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
|
||||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
finalize:
|
||||
needs: [ docker, plugin_api ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Commit version bump
|
||||
if: ${{ github.event.inputs.update_version }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v6
|
||||
with:
|
||||
commit_message: 'chore: release v${{ env.RELEASE_VERSION }}'
|
||||
tagging_message: v${{ env.RELEASE_VERSION }}
|
||||
|
||||
commit_message: 'chore: release v${{ needs.setup.outputs.release_version }}'
|
||||
tagging_message: v${{ needs.setup.outputs.release_version }}
|
||||
- name: Detect prerelease
|
||||
id: detect_prerelease
|
||||
run: |
|
||||
if [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
if [[ "${{ needs.setup.outputs.release_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
|
||||
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
|
||||
echo "MAKE_LATEST=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Create GitHub release
|
||||
if: ${{ github.event.inputs.update_version }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: v${{ env.RELEASE_VERSION }}
|
||||
tag_name: v${{ needs.setup.outputs.release_version }}
|
||||
prerelease: ${{ env.IS_PRERELEASE }}
|
||||
make_latest: ${{ env.MAKE_LATEST }}
|
||||
|
||||
Reference in New Issue
Block a user