Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

Commit 272b6de

Browse files
ci: adjust repository publishing
1 parent 37eef76 commit 272b6de

File tree

4 files changed

+129
-26
lines changed

4 files changed

+129
-26
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,9 @@ jobs:
1717
setup_release:
1818
name: Setup Release
1919
outputs:
20-
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
21-
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
22-
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
23-
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
24-
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
25-
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
26-
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
2720
publish_release: ${{ steps.setup_release.outputs.publish_release }}
28-
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
29-
release_body: ${{ steps.setup_release.outputs.release_body }}
3021
release_build: ${{ steps.setup_release.outputs.release_build }}
3122
release_commit: ${{ steps.setup_release.outputs.release_commit }}
32-
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
3323
release_tag: ${{ steps.setup_release.outputs.release_tag }}
3424
release_version: ${{ steps.setup_release.outputs.release_version }}
3525
runs-on: ubuntu-latest
@@ -39,7 +29,7 @@ jobs:
3929

4030
- name: Setup Release
4131
id: setup_release
42-
uses: LizardByte/setup-release-action@v2024.516.190324
32+
uses: LizardByte/setup-release-action@fix!-updates # todo: change to latest
4333
with:
4434
dotnet: true
4535
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -102,11 +92,10 @@ jobs:
10292
uses: LizardByte/create-release-action@v2024.516.190229
10393
with:
10494
allowUpdates: true
105-
body: ''
10695
discussionCategory: announcements
10796
generateReleaseNotes: true
10897
name: ${{ needs.setup_release.outputs.release_tag }}
109-
prerelease: ${{ needs.setup_release.outputs.publish_pre_release }}
98+
prerelease: true
11099
tag: ${{ needs.setup_release.outputs.release_tag }}
111100
token: ${{ secrets.GH_BOT_TOKEN }}
112101

.github/workflows/ci-docker.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,10 @@ jobs:
102102
needs:
103103
- check_dockerfiles
104104
outputs:
105-
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
106-
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
107-
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
108-
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
109-
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
110-
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
111-
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
112105
publish_release: ${{ steps.setup_release.outputs.publish_release }}
113-
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
114106
release_body: ${{ steps.setup_release.outputs.release_body }}
115107
release_build: ${{ steps.setup_release.outputs.release_build }}
116108
release_commit: ${{ steps.setup_release.outputs.release_commit }}
117-
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
118109
release_tag: ${{ steps.setup_release.outputs.release_tag }}
119110
release_version: ${{ steps.setup_release.outputs.release_version }}
120111
runs-on: ubuntu-latest
@@ -124,7 +115,7 @@ jobs:
124115

125116
- name: Setup Release
126117
id: setup_release
127-
uses: LizardByte/setup-release-action@v2024.516.190324
118+
uses: LizardByte/setup-release-action@fix!-updates # todo: change to latest
128119
with:
129120
dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }}
130121
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -373,15 +364,14 @@ jobs:
373364

374365
- name: Create/Update GitHub Release
375366
if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
376-
uses: LizardByte/create-release-action@v2024.516.190229
367+
uses: LizardByte/create-release-action@fix!-updates # todo: change to latest
377368
with:
378369
allowUpdates: true
379370
artifacts: "*artifacts/*"
380-
body: ''
381371
discussionCategory: announcements
382372
generateReleaseNotes: true
383373
name: ${{ needs.setup_release.outputs.release_tag }}
384-
prerelease: ${{ needs.setup_release.outputs.publish_pre_release }}
374+
prerelease: true
385375
tag: ${{ needs.setup_release.outputs.release_tag }}
386376
token: ${{ secrets.GH_BOT_TOKEN }}
387377

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Update changelog on release events.
7+
8+
name: Update changelog
9+
10+
on:
11+
release:
12+
types: [created, edited, deleted]
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: "${{ github.workflow }}"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
update-changelog:
21+
if: >-
22+
github.event_name == 'workflow_dispatch' ||
23+
(!github.event.release.prerelease && !github.event.release.draft)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Update Changelog
27+
uses: LizardByte/update-changelog-action@v2024.520.183314
28+
with:
29+
changelogBranch: changelog
30+
changelogFile: CHANGELOG.md
31+
token: ${{ secrets.GH_BOT_TOKEN }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
3+
# If more Jellyfin plugins are developed, consider moving this action to the organization's .github repository,
4+
# using the `jellyfin-plugin` repository label to identify repositories that should trigger have this workflow.
5+
6+
# Update Jellyfin repository on release events.
7+
8+
name: Update Jellyfin release
9+
10+
on:
11+
release:
12+
types: [created, edited, deleted]
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
update-jellyfin-release:
20+
if: >-
21+
!github.event.release.draft
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check if Jellyfin repo
25+
id: isJellyfinRepo
26+
uses: actions/github-script@v7
27+
with:
28+
script: |
29+
const repo = context.payload.repository;
30+
const repoLabels = await github.repos.listLabelsForRepo({
31+
owner: repo.owner.login,
32+
repo: repo.name
33+
});
34+
const isJellyfinRepo = repoLabels.data.some(label => label.name === 'jellyfin-plugin');
35+
core.setOutput('isJellyfinRepo', isJellyfinRepo);
36+
37+
- name: Download release asset
38+
id: download
39+
if: >-
40+
steps.isJellyfinRepo.outputs.isJellyfinRepo == 'true' &&
41+
github.event.action != 'deleted'
42+
uses: robinraju/release-downloader@v1.10
43+
with:
44+
repository: "${{ github.repository }}"
45+
tag: "${{ github.event.release.tag_name }}"
46+
fileName: "*.zip"
47+
tarBall: false
48+
zipBall: false
49+
out-file-path: "release_downloads"
50+
extract: false
51+
52+
- name: Loop through downloaded files
53+
if: >-
54+
steps.isJellyfinRepo.outputs.isJellyfinRepo == 'true' &&
55+
github.event.action != 'deleted'
56+
id: loop
57+
run: |
58+
files=${{ fromJson(steps.download.outputs.downloaded_files) }}
59+
file_number=0
60+
plugin=""
61+
for file in "${files[@]}"; do
62+
echo "$file"
63+
64+
# extract the zip file
65+
unzip -o $file -d ./release_downloads/$file_number
66+
67+
# check if the extracted file contains a meta.json file
68+
if [ -f ./release_downloads/$file_number/meta.json ]; then
69+
plugin=$file
70+
break
71+
fi
72+
73+
file_number=$((file_number+1))
74+
done
75+
76+
if [ -z "$plugin" ]; then
77+
echo "No plugin found in the downloaded files"
78+
exit 1
79+
fi
80+
81+
echo "plugin_zip=$plugin" >> $GITHUB_OUTPUT
82+
83+
- name: Create/Update Jellyfin Release
84+
if: >-
85+
steps.isJellyfinRepo.outputs.isJellyfinRepo == 'true'
86+
uses: LizardByte/jellyfin-plugin-repo@feat!-new-release-style # todo: update version
87+
with:
88+
action: ${{ github.event.action == 'deleted' && 'remove' || 'add' }}
89+
github_token: ${{ secrets.GH_BOT_TOKEN }}
90+
committer_email: ${{ secrets.GH_BOT_EMAIL }}
91+
committer_name: ${{ secrets.GH_BOT_NAME }}
92+
release_tag: ${{ github.event.release.tag_name }}
93+
zipfile: ${{ steps.loop.outputs.plugin_zip }}

0 commit comments

Comments
 (0)