Replace upstream GitHub workflows with IUCLabs CI and release
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
2026-12-02 21:49:53 +11:00
parent a477b2f84c
commit 1877dda671
18 changed files with 141 additions and 307 deletions
-39
View File
@@ -1,39 +0,0 @@
on:
workflow_call:
inputs:
dotnet-version:
required: false
default: "9.0.x"
description: "The .NET version to setup for the build"
type: string
dotnet-target:
required: false
default: "net9.0"
description: "The .NET target to set for JPRM"
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "${{ inputs.dotnet-version }}"
- name: Build Jellyfin Plugin
uses: oddstr13/jellyfin-plugin-repository-manager@9497a0a499416cc572ed2e07a391d9f943a37b4d # v1.1.1
id: jprm
with:
dotnet-target: "${{ inputs.dotnet-target }}"
- name: Upload Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
with:
name: build-artifact
retention-days: 30
if-no-files-found: error
path: ${{ steps.jprm.outputs.artifact }}
+45
View File
@@ -0,0 +1,45 @@
name: ci
on:
pull_request:
push:
branches: [main]
permissions: {}
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
ci:
uses: IUCLabs/workflows/.github/workflows/pre-commit.yml@v0.1.1
permissions:
contents: read
with:
runs_on: iuclabs-k8s
actions:
uses: IUCLabs/workflows/.github/workflows/actions.yml@v0.1.1
permissions:
contents: read
with:
runs_on: ubuntu-latest
dotnet:
runs-on: iuclabs-k8s
permissions:
contents: read
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: 10.0.x
- run: dotnet restore SSO-Auth.sln
- run: dotnet build SSO-Auth.sln -c Release --no-restore --warnaserror
- run: dotnet test SSO-Auth.sln -c Release --no-build --verbosity minimal
-25
View File
@@ -1,25 +0,0 @@
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --warnaserror
- name: Test
run: dotnet test --no-build --verbosity normal
-23
View File
@@ -1,23 +0,0 @@
name: Prettier Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Prettify code
uses: creyD/prettier_action@v4.3
with:
dry: True
prettier_options: '--check **/*.{js,html,md,css,scss}'
-71
View File
@@ -1,71 +0,0 @@
name: Publish Nightly
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build Dotnet
run: dotnet build --no-restore --warnaserror
- name: "Flag as nightly in build.yaml"
uses: fjogeleit/yaml-update-action@v0.10.0
with:
valueFile: 'build.yaml'
propertyPath: 'version'
value: "0.0.0.9000"
commitChange: false
updateFile: true
- name: "JPRM: Build"
id: jrpm
uses: oddstr13/jellyfin-plugin-repository-manager@9497a0a499416cc572ed2e07a391d9f943a37b4d # v1.1.1
with:
version: "0.0.0.9000"
verbosity: debug
path: .
dotnet-target: "net9.0"
output: _dist
- name: Prepare GitHub Release assets
run: |-
pushd _dist
for file in ./*.zip; do
md5sum ${file#./} >> ${file%.*}.md5
sha256sum ${file#./} >> ${file%.*}.sha256
done
ls -l
popd
- name: Publish output artifacts
id: publish-assets
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
with:
prerelease: false
fail_on_unmatched_files: true
tag_name: nightly
files: |
_dist/*
build.yaml
body: |
Nightly build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Plugin Manifest
uses: Kevinjil/jellyfin-plugin-repo-action@a7832ecc44c6b1a45d531970f6647b8682b005b8
with:
ignorePrereleases: true
githubToken: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pagesBranch: manifest-release
pagesFile: manifest.json
-53
View File
@@ -1,53 +0,0 @@
name: Publish Release
on:
release:
types:
- released
workflow_dispatch:
jobs:
build:
uses: ./.github/workflows/build.yml
with:
dotnet-version: "9.0.*"
dotnet-target: "net9.0"
upload:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download Artifact
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: build-artifact
- name: Prepare GitHub Release assets
run: |-
for file in ./*; do
md5sum ${file#./} >> ${file%.*}.md5
sha256sum ${file#./} >> ${file%.*}.sha256
done
ls -l
- name: Publish output artifacts
id: publish-assets
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
with:
prerelease: false
fail_on_unmatched_files: true
tag_name: ${{ github.event.release.tag_name }}
files: ./*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
generate:
runs-on: ubuntu-latest
needs:
- upload
steps:
- name: Publish Plugin Manifest
uses: Kevinjil/jellyfin-plugin-repo-action@a7832ecc44c6b1a45d531970f6647b8682b005b8
with:
ignorePrereleases: true
githubToken: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pagesBranch: manifest-release
pagesFile: manifest.json
+65
View File
@@ -0,0 +1,65 @@
name: release
on:
push:
tags: ["v[0-9]*"]
permissions: {}
jobs:
release:
runs-on: iuclabs-release
permissions:
contents: read
id-token: write
env:
VAULT_ADDR: https://vault.service.consul:8200
ARTIFACTAPI: https://artifactapi.k8s.syd1.au.unkin.net
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: 10.0.x
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- name: build plugin
run: |
set -euo pipefail
version=$(sed -n 's/^version: *"\([0-9.]*\)".*/\1/p' build.yaml | head -1)
if [ "v${version}" != "${TAG}" ]; then
echo "::error::tag ${TAG} does not match build.yaml version ${version}; use make patch/minor/major/hotfix"
exit 1
fi
mkdir -p dist
uvx --from jprm==1.1.0 jprm plugin build . --output ./dist --version "${version}" --dotnet-configuration Release --dotnet-framework net10.0
sha256sum dist/*.zip
# login after the build: vault tokens live 15m
- uses: hashicorp/vault-action@892a26828f195e65540a40b4768ae4571f51ebfc # v4.0.0
with:
url: ${{ env.VAULT_ADDR }}
method: jwt
path: jwt/github/iuclabs
role: release
jwtGithubAudience: ${{ env.VAULT_ADDR }}
secrets: |
identity/oidc/token/artifactapi-writer token | ARTIFACTAPI_TOKEN
# uploads are immutable (409 on overwrite) and artifactapi has no HEAD route; an existing object is a no-op re-run
- name: publish
run: |
set -euo pipefail
zips=(dist/sso-authentication_*.zip)
zip="${zips[0]}"
url="${ARTIFACTAPI}/api/v2/remotes/jellyfin-plugins/files/unkin/jellyfin-plugin-sso/${TAG#v}/$(basename "${zip}")"
code=$(curl -s --cacert /etc/vault-ca/ca.crt -o /dev/null -w '%{http_code}' "${url}" || true)
if [ "${code}" = 200 ]; then
echo "${url} already published; skipping"
exit 0
fi
auth="${RUNNER_TEMP}/auth"
printf 'Authorization: Bearer %s\n' "${ARTIFACTAPI_TOKEN}" > "${auth}"
curl -fsS --cacert /etc/vault-ca/ca.crt -X PUT "${url}" \
-H "Content-Type: application/zip" -H @"${auth}" --data-binary @"${zip}"