mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +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
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
setup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
env:
|
env:
|
||||||
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||||
|
outputs:
|
||||||
|
release_version: ${{ steps.get_version.outputs.release_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Needed for git tag
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
|
|
||||||
- name: Get version from build.gradle.kts if not provided
|
- name: Get version from build.gradle.kts if not provided
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ github.event.inputs.version }}" ]; then
|
if [ -z "${{ github.event.inputs.version }}" ]; then
|
||||||
VERSION=$(grep '^version = ' build.gradle.kts | sed 's/version = "\(.*\)"/\1/')
|
VERSION=$(grep '^version = ' build.gradle.kts | sed 's/version = "\(.*\)"/\1/')
|
||||||
|
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
|
echo "release_version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||||
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Update version in build.gradle.kts
|
- name: Update version in build.gradle.kts
|
||||||
if: ${{ github.event.inputs.update_version }}
|
if: ${{ github.event.inputs.update_version }}
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/^version = .*/version = \"$RELEASE_VERSION\"/" build.gradle.kts
|
sed -i "s/^version = .*/version = \"$RELEASE_VERSION\"/" build.gradle.kts
|
||||||
|
|
||||||
- name: Update version in app/package.json
|
- name: Update version in app/package.json
|
||||||
if: ${{ github.event.inputs.update_version }}
|
if: ${{ github.event.inputs.update_version }}
|
||||||
run: |
|
run: |
|
||||||
jq ".version = \"$RELEASE_VERSION\"" app/package.json > app/package.json.tmp && mv app/package.json.tmp app/package.json
|
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
|
- name: Run production build
|
||||||
env:
|
env:
|
||||||
GAMEYFIN_KEYSTORE_PASSWORD: ${{ secrets.GAMEYFIN_KEYSTORE_PASSWORD }}
|
GAMEYFIN_KEYSTORE_PASSWORD: ${{ secrets.GAMEYFIN_KEYSTORE_PASSWORD }}
|
||||||
run: ./gradlew clean build -Pvaadin.productionMode=true
|
run: ./gradlew clean build -Pvaadin.productionMode=true
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
@@ -72,30 +82,62 @@ jobs:
|
|||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
platforms: linux/arm64/v8,linux/amd64
|
platforms: linux/arm64/v8,linux/amd64
|
||||||
push: true
|
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
|
- name: Commit version bump
|
||||||
if: ${{ github.event.inputs.update_version }}
|
if: ${{ github.event.inputs.update_version }}
|
||||||
uses: stefanzweifel/git-auto-commit-action@v6
|
uses: stefanzweifel/git-auto-commit-action@v6
|
||||||
with:
|
with:
|
||||||
commit_message: 'chore: release v${{ env.RELEASE_VERSION }}'
|
commit_message: 'chore: release v${{ needs.setup.outputs.release_version }}'
|
||||||
tagging_message: v${{ env.RELEASE_VERSION }}
|
tagging_message: v${{ needs.setup.outputs.release_version }}
|
||||||
|
|
||||||
- name: Detect prerelease
|
- name: Detect prerelease
|
||||||
id: detect_prerelease
|
id: detect_prerelease
|
||||||
run: |
|
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 "IS_PRERELEASE=false" >> $GITHUB_ENV
|
||||||
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
|
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
|
||||||
echo "MAKE_LATEST=false" >> $GITHUB_ENV
|
echo "MAKE_LATEST=false" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
if: ${{ github.event.inputs.update_version }}
|
if: ${{ github.event.inputs.update_version }}
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ env.RELEASE_VERSION }}
|
tag_name: v${{ needs.setup.outputs.release_version }}
|
||||||
prerelease: ${{ env.IS_PRERELEASE }}
|
prerelease: ${{ env.IS_PRERELEASE }}
|
||||||
make_latest: ${{ env.MAKE_LATEST }}
|
make_latest: ${{ env.MAKE_LATEST }}
|
||||||
|
|||||||
Reference in New Issue
Block a user