Skip to content

Commit 125cb33

Browse files
authored
Update publish.yaml
1 parent 5cb0371 commit 125cb33

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed

.github/workflows/publish.yaml

+59-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,64 @@
11
name: '🚀 Publish Plugin'
2-
32
on:
4-
release:
5-
types:
6-
- released
73
workflow_dispatch:
84

5+
permissions:
6+
contents: write
7+
packages: write
8+
99
jobs:
10-
call:
11-
uses: jellyfin/jellyfin-meta-plugins/.github/workflows/publish.yaml@master
12-
with:
13-
version: ${{ github.event.release.tag_name }}
14-
is-unstable: ${{ github.event.release.prerelease }}
15-
secrets:
16-
deploy-host: ${{ secrets.DEPLOY_HOST }}
17-
deploy-user: ${{ secrets.DEPLOY_USER }}
18-
deploy-key: ${{ secrets.DEPLOY_KEY }}
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Read version from variable
17+
id: read-version
18+
run: |
19+
NEW_FILE_VERSION=1.0.2
20+
echo "NEW_FILE_VERSION=${NEW_FILE_VERSION}" >> $GITHUB_ENV
21+
GIT_HASH=$(git rev-parse --short HEAD)
22+
echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV
23+
24+
- name: Check for BETA file
25+
id: check-beta
26+
run: |
27+
if [ -f "BETA" ]; then
28+
echo "IS_BETA=true" >> $GITHUB_ENV
29+
else
30+
echo "IS_BETA=false" >> $GITHUB_ENV
31+
fi
32+
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: 8.0.x
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: "lts/*"
42+
43+
- name: Restore Beta dependencies
44+
if: ${{env.IS_BETA == 'true' }}
45+
run: |
46+
dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name jellyfin-pre "https://nuget.pkg.github.com/jellyfin/index.json"
47+
dotnet tool install --global dotnet-outdated-tool
48+
dotnet outdated -pre Always -u -inc Jellyfin
49+
50+
- name: Restore dependencies
51+
if: ${{env.IS_BETA == 'false' }}
52+
run: dotnet restore
53+
54+
- name: Build
55+
run: dotnet build --configuration Release --no-restore
56+
57+
- name: Create archive
58+
run: zip -j "Jellyfin.Plugin.MediaSegmentsApi-${{ env.NEW_FILE_VERSION }}.zip" Jellyfin.Plugin.MediaSegmentsApi/bin/Release/net8.0/Jellyfin.Plugin.MediaSegmentsApi.dll
59+
60+
- name: Create new release with tag
61+
if: github.event_name != 'pull_request'
62+
run: gh release create "${{ env.NEW_FILE_VERSION }}-${{ env.GIT_HASH }}" "Jellyfin.Plugin.MediaSegmentsApi-${{ env.NEW_FILE_VERSION }}.zip" --title "Release ${{ env.NEW_FILE_VERSION }}-${{ env.GIT_HASH }}" --latest --generate-notes --target master
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)