mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
* ci: add yaml-langage-server to workflow files Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr> * ci: add stale workflow Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr> --------- Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
213 lines
6.3 KiB
YAML
213 lines
6.3 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
name: Jellyseerr Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
semantic-release:
|
|
name: Tag and release latest version
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
HUSKY: 0
|
|
outputs:
|
|
new_release_published: ${{ steps.release.outputs.new_release_published }}
|
|
new_release_version: ${{ steps.release.outputs.new_release_version }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: package.json
|
|
|
|
- name: Pnpm Setup
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Get pnpm store directory
|
|
shell: sh
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Release
|
|
id: release
|
|
uses: cycjimmy/semantic-release-action@v5
|
|
with:
|
|
extra_plugins: |
|
|
@semantic-release/git@10
|
|
@semantic-release/changelog@6
|
|
@codedependant/semantic-release-docker@5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
|
build:
|
|
name: Build (per-arch, native runners)
|
|
needs: semantic-release
|
|
if: needs.semantic-release.outputs.new_release_published == 'true'
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-24.04
|
|
platform: linux/amd64
|
|
arch: amd64
|
|
- runner: ubuntu-24.04-arm
|
|
platform: linux/arm64
|
|
arch: arm64
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Commit timestamp
|
|
id: ts
|
|
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Warm cache (no push) — ${{ matrix.platform }}
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
push: false
|
|
build-args: |
|
|
COMMIT_TAG=${{ github.sha }}
|
|
BUILD_VERSION=${{ needs.semantic-release.outputs.new_release_version }}
|
|
SOURCE_DATE_EPOCH=${{ steps.ts.outputs.TIMESTAMP }}
|
|
cache-from: type=gha,scope=${{ matrix.platform }}
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
|
provenance: false
|
|
|
|
publish:
|
|
name: Publish multi-arch image
|
|
needs: [semantic-release, build]
|
|
if: needs.semantic-release.outputs.new_release_published == 'true'
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
packages: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Commit timestamp
|
|
id: ts
|
|
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
|
|
|
|
- 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.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ github.repository }}
|
|
ghcr.io/${{ github.repository }}
|
|
tags: |
|
|
type=raw,value=${{ needs.semantic-release.outputs.new_release_version }}
|
|
labels: |
|
|
org.opencontainers.image.created=${{ steps.ts.outputs.TIMESTAMP }}
|
|
|
|
- name: Build & Push (multi-arch, single tag)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
build-args: |
|
|
COMMIT_TAG=${{ github.sha }}
|
|
BUILD_VERSION=${{ needs.semantic-release.outputs.new_release_version }}
|
|
SOURCE_DATE_EPOCH=${{ steps.ts.outputs.TIMESTAMP }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
cache-from: |
|
|
type=gha,scope=linux/amd64
|
|
type=gha,scope=linux/arm64
|
|
cache-to: type=gha,mode=max
|
|
provenance: false
|
|
|
|
- name: Also tag :latest (non-pre-release only)
|
|
shell: bash
|
|
run: |
|
|
VER="${{ needs.semantic-release.outputs.new_release_version }}"
|
|
if [[ "$VER" != *"-"* ]]; then
|
|
docker buildx imagetools create \
|
|
-t ${{ github.repository }}:latest \
|
|
${{ github.repository }}:${VER}
|
|
docker buildx imagetools create \
|
|
-t ghcr.io/${{ github.repository }}:latest \
|
|
ghcr.io/${{ github.repository }}:${VER}
|
|
fi
|
|
|
|
discord:
|
|
name: Send Discord Notification
|
|
needs: publish
|
|
if: always()
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Get Build Job Status
|
|
uses: technote-space/workflow-conclusion-action@v3
|
|
|
|
- name: Combine Job Status
|
|
id: status
|
|
run: |
|
|
failures=(neutral, skipped, timed_out, action_required)
|
|
if [[ ${array[@]} =~ $WORKFLOW_CONCLUSION ]]; then
|
|
echo "status=failure" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "status=$WORKFLOW_CONCLUSION" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Post Status to Discord
|
|
uses: sarisia/actions-status-discord@v1
|
|
with:
|
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
|
status: ${{ steps.status.outputs.status }}
|
|
title: ${{ github.workflow }}
|
|
nofail: true
|