Files
gameyfin/.github/workflows/release.yml
T
dependabot[bot] d4a2e2e934 Bump actions/setup-java from 3 to 4 (#218)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-28 19:13:50 +01:00

115 lines
3.8 KiB
YAML

name: Gameyfin Release
on:
workflow_dispatch:
inputs:
branch:
description: "The branch to checkout when cutting the release."
required: true
default: "main"
releaseVersion:
description: "Default version to use when preparing a release."
required: true
default: "X.Y.Z"
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
jobs:
release:
runs-on: ubuntu-latest
name: Release
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Configure Git User
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
- name: Maven Release
run: mvn release:prepare release:perform -B -s .maven_settings.xml -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} -Darguments="-Dmaven.deploy.skip=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true"
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
- name: Git tag
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ github.token }}
default_bump: false
custom_tag: ${{ github.event.inputs.releaseVersion }}
- name: Github Release
uses: "marvinpinto/action-automatic-releases@v1.2.1"
with:
repo_token: ${{ github.token }}
prerelease: false
automatic_release_tag: v${{ github.event.inputs.releaseVersion }}
files: |
LICENSE.md
backend/target/gameyfin-*.jar
config/gameyfin.properties
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
grimsi/gameyfin
tags: |
type=semver,pattern={{version}},value=${{ github.event.inputs.releaseVersion }}
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.inputs.releaseVersion }}
type=semver,pattern={{major}},value=${{ github.event.inputs.releaseVersion }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move Docker cache (temp fix)
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache