Skip to content

Release

Release #31

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
emby_version:
description: "The Emby server version for this release (e.g., 4.8.11.0)."
type: string
required: true
default: 4.8.11.0
your_mb3admin_replacement_url:
description: >-
URL for Emby's server replacement. Must starts with 'http' and end with a '/'.
type: string
required: true
default: https://mb3admin.megm.workers.dev/
remote_debug:
description: >-
Starts an SSH session to debug the runner. For advanced troubleshooting only.
type: boolean
required: false
default: false
publish: # New input for publishing
description: "Publish to GitHub Release and create a tag (as a draft first)"
type: boolean
required: false
default: false
jobs:
build: # This job will now handle both build and conditional release
runs-on: ubuntu-latest
env:
EMBY_REPLACEMENT_URL: ${{ inputs.your_mb3admin_replacement_url }}
EMBY_VERSION: ${{ inputs.emby_version }}
permissions: # Permissions needed for creating releases and tags in this job
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
# with:
# fetch-depth: 0 # Fetch all history for tag creation, needed for git tag
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.44.0
- name: Verify environment node
run: |
node --version
npm --version
pnpm --version
- name: Start debug session (when enabled)
if: ${{ inputs.remote_debug }}
uses: lhotari/action-upterm@v1
- name: Verify environment os
run: |
./build.sh prepare:prepare
- name: Build
run: |
./build.sh
mv ./tmp/build/dist embyhack
- name: Validate artifact
run: test -d embyhack
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: docker-embyhack
path: embyhack
# --- Release steps, now conditional and within the 'build' job ---
- name: Create zip archive for release
run: zip -r docker-embyhack.zip embyhack
if: ${{ inputs.publish }} # Only run if publishing
- name: Get current date and time
id: date
if: ${{ inputs.publish }} # Only run if publishing
run: echo "NOW=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Determine tag name
id: set_tag
if: ${{ inputs.publish }} # Only run if publishing
run: |

Check failure on line 102 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/build.yaml (Line: 102, Col: 14): Unrecognized named-value: 'PRERELEASE_SUFFIX'. Located at position 1 within expression: PRERELEASE_SUFFIX
PRERELEASE_SUFFIX=""
if [[ "${{ github.ref_name }}" != "main" ]]; then
PRERELEASE_SUFFIX="-prerelease"
fi
TAG_NAME="v${{ inputs.emby_version }}${{ PRERELEASE_SUFFIX }}-${{ steps.date.outputs.NOW }}"
RELEASE_NAME="Release $TAG_NAME"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_OUTPUT
echo "Automated release from GitHub Actions. \
Branch: ${{ github.ref_name }} \
Commit: ${{ github.sha }} \
Build Date: ${{ steps.date.outputs.NOW }} \
Emby Version: ${{ inputs.emby_version }}" > Release.txt
cat Release.txt > Release_body.txt
echo "**This is a DRAFT release. Please verify the artifact before publishing.**" >> Release_body.txt
- name: Create and push tag
if: ${{ inputs.publish }} # Only run if publishing
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.set_tag.outputs.TAG_NAME }}
git push origin ${{ steps.set_tag.outputs.TAG_NAME }}
- name: Create GitHub Release (as Draft)
if: ${{ inputs.publish }} # Only run if publishing
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.set_tag.outputs.TAG_NAME }}
name: ${{ steps.set_tag.outputs.RELEASE_NAME }}
body_path: Release_body.txt
draft: true # Set to true to create a draft release for manual verification
prerelease: ${{ github.ref_name != 'main' }} # Mark as prerelease if not on main branch
files: |
Release.txt
docker-embyhack.zip # Attach the newly created zipped file from the same runner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is automatically provided by GitHub Actions