name: Release Plugins on: push: branches: - main tags: - 'v*' workflow_dispatch: inputs: version: description: 'Release version (e.g. v1.0.1). Leave blank to use the tag or "latest".' required: false default: '' jobs: release: name: Package & Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Determine release tag id: tag run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" elif [[ -n "${{ github.event.inputs.version }}" ]]; then echo "tag=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT" else echo "tag=latest" >> "$GITHUB_OUTPUT" fi - name: Create plugin ZIPs run: | mkdir -p dist # Full suite ZIP (all LocalFlowPlugins + FlowHelpers) zip -r dist/Tdarr-plugins-${{ steps.tag.outputs.tag }}.zip \ LocalFlowPlugins/ \ FlowHelpers/ \ -x "*.git*" # Individual plugin ZIPs for dir in LocalFlowPlugins/*/*/1.0.0; do plugin_name=$(echo "$dir" | awk -F'/' '{print $(NF-1)}') zip -j "dist/${plugin_name}-${{ steps.tag.outputs.tag }}.zip" "$dir/index.js" done ls -lh dist/ - name: Delete existing "latest" release (if re-releasing) if: steps.tag.outputs.tag == 'latest' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release delete latest --yes --cleanup-tag 2>/dev/null || true - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.tag.outputs.tag }} name: "Tdarr Plugins ${{ steps.tag.outputs.tag }}" body: | ## Tdarr Local Flow Plugin Suite — ${{ steps.tag.outputs.tag }} ### Installation (curl) Download the full suite: ```bash curl -L https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/Tdarr-plugins-${{ steps.tag.outputs.tag }}.zip -o plugins.zip unzip plugins.zip -d /path/to/tdarr/plugins/ ``` Or download an individual plugin (example: `transcode2PassX265`): ```bash curl -L https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/transcode2PassX265-${{ steps.tag.outputs.tag }}.zip -o transcode2PassX265.zip unzip transcode2PassX265.zip -d /path/to/tdarr/plugins/LocalFlowPlugins/video/transcode2PassX265/1.0.0/ ``` See the [README](https://github.com/${{ github.repository }}#readme) for full installation instructions. files: dist/*.zip prerelease: ${{ steps.tag.outputs.tag == 'latest' }} make_latest: ${{ steps.tag.outputs.tag != 'latest' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}