mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #6980 from brianjmurrell/ci-autoversion-packages
This commit is contained in:
commit
843ba4506e
@ -39,6 +39,14 @@ jobs:
|
|||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- script: echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
|
||||||
|
displayName: Set release version (stable)
|
||||||
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
|
- script: './bump-version $(JellyfinVersion)'
|
||||||
|
displayName: Bump internal version (stable)
|
||||||
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-server-$(BuildConfiguration) deployment'
|
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-server-$(BuildConfiguration) deployment'
|
||||||
displayName: 'Build Dockerfile'
|
displayName: 'Build Dockerfile'
|
||||||
|
|
||||||
@ -80,6 +88,14 @@ jobs:
|
|||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- script: echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
|
||||||
|
displayName: Set release version (stable)
|
||||||
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
|
- script: './bump-version $(JellyfinVersion)'
|
||||||
|
displayName: Bump internal version (stable)
|
||||||
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: 'Download OpenAPI Spec'
|
displayName: 'Download OpenAPI Spec'
|
||||||
inputs:
|
inputs:
|
||||||
@ -127,6 +143,10 @@ jobs:
|
|||||||
displayName: Set release version (stable)
|
displayName: Set release version (stable)
|
||||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
|
- script: './bump-version $(JellyfinVersion)'
|
||||||
|
displayName: Bump internal version (stable)
|
||||||
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
|
||||||
|
|
||||||
- task: Docker@2
|
- task: Docker@2
|
||||||
displayName: 'Push Unstable Image'
|
displayName: 'Push Unstable Image'
|
||||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
22
bump_version
22
bump_version
@ -52,7 +52,8 @@ echo $old_version
|
|||||||
|
|
||||||
# Set the build.yaml version to the specified new_version
|
# Set the build.yaml version to the specified new_version
|
||||||
old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' chars
|
old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' chars
|
||||||
sed -i "s/${old_version_sed}/${new_version}/g" ${build_file}
|
new_version_sed="$( cut -f1 -d'-' <<<"${new_version}" )"
|
||||||
|
sed -i "s/${old_version_sed}/${new_version_sed}/g" ${build_file}
|
||||||
|
|
||||||
# update nuget package version
|
# update nuget package version
|
||||||
for subproject in ${jellyfin_subprojects[@]}; do
|
for subproject in ${jellyfin_subprojects[@]}; do
|
||||||
@ -64,26 +65,29 @@ for subproject in ${jellyfin_subprojects[@]}; do
|
|||||||
| sed -E 's/<VersionPrefix>([0-9\.]+[-a-z0-9]*)<\/VersionPrefix>/\1/'
|
| sed -E 's/<VersionPrefix>([0-9\.]+[-a-z0-9]*)<\/VersionPrefix>/\1/'
|
||||||
)"
|
)"
|
||||||
echo old nuget version: $old_version
|
echo old nuget version: $old_version
|
||||||
|
new_version_sed="$( cut -f1 -d'-' <<<"${new_version}" )"
|
||||||
|
|
||||||
# Set the nuget version to the specified new_version
|
# Set the nuget version to the specified new_version
|
||||||
sed -i "s|${old_version}|${new_version}|g" ${subproject}
|
sed -i "s|${old_version}|${new_version_sed}|g" ${subproject}
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ${new_version} == *"-"* ]]; then
|
if [[ ${new_version} == *"-"* ]]; then
|
||||||
new_version_deb="$( sed 's/-/~/g' <<<"${new_version}" )"
|
new_version_pkg="$( sed 's/-/~/g' <<<"${new_version}" )"
|
||||||
|
new_version_deb_sup=""
|
||||||
else
|
else
|
||||||
new_version_deb="${new_version}-1"
|
new_version_pkg="${new_version}"
|
||||||
|
new_version_deb_sup="-1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update the metapackage equivs file
|
# Update the metapackage equivs file
|
||||||
debian_equivs_file="debian/metapackage/jellyfin"
|
debian_equivs_file="debian/metapackage/jellyfin"
|
||||||
sed -i "s/${old_version_sed}/${new_version}/g" ${debian_equivs_file}
|
sed -i "s/${old_version_sed}/${new_version_pkg}/g" ${debian_equivs_file}
|
||||||
|
|
||||||
# Write out a temporary Debian changelog with our new stuff appended and some templated formatting
|
# Write out a temporary Debian changelog with our new stuff appended and some templated formatting
|
||||||
debian_changelog_file="debian/changelog"
|
debian_changelog_file="debian/changelog"
|
||||||
debian_changelog_temp="$( mktemp )"
|
debian_changelog_temp="$( mktemp )"
|
||||||
# Create new temp file with our changelog
|
# Create new temp file with our changelog
|
||||||
echo -e "jellyfin-server (${new_version_deb}) unstable; urgency=medium
|
echo -e "jellyfin-server (${new_version_pkg}${new_version_deb_sup}) unstable; urgency=medium
|
||||||
|
|
||||||
* New upstream version ${new_version}; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v${new_version}
|
* New upstream version ${new_version}; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v${new_version}
|
||||||
|
|
||||||
@ -104,7 +108,7 @@ pushd ${fedora_spec_temp_dir}
|
|||||||
# Split out the stuff before and after changelog
|
# Split out the stuff before and after changelog
|
||||||
csplit jellyfin.spec "/^%changelog/" # produces xx00 xx01
|
csplit jellyfin.spec "/^%changelog/" # produces xx00 xx01
|
||||||
# Update the version in xx00
|
# Update the version in xx00
|
||||||
sed -i "s/${old_version_sed}/${new_version_sed}/g" xx00
|
sed -i "s/${old_version_sed}/${new_version_pkg}/g" xx00
|
||||||
# Remove the header from xx01
|
# Remove the header from xx01
|
||||||
sed -i '/^%changelog/d' xx01
|
sed -i '/^%changelog/d' xx01
|
||||||
# Create new temp file with our changelog
|
# Create new temp file with our changelog
|
||||||
@ -121,5 +125,5 @@ mv ${fedora_spec_temp} ${fedora_spec_file}
|
|||||||
rm -rf ${fedora_spec_temp_dir}
|
rm -rf ${fedora_spec_temp_dir}
|
||||||
|
|
||||||
# Stage the changed files for commit
|
# Stage the changed files for commit
|
||||||
git add ${shared_version_file} ${build_file} ${debian_equivs_file} ${debian_changelog_file} ${fedora_spec_file}
|
git add .
|
||||||
git status
|
git status -v
|
||||||
|
@ -1,26 +1,41 @@
|
|||||||
VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec)
|
VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec)
|
||||||
|
outdir ?= fedora/
|
||||||
|
TARGET ?= fedora-35-x86_64
|
||||||
|
|
||||||
srpm:
|
srpm:
|
||||||
cd fedora/; \
|
pushd fedora/; \
|
||||||
SOURCE_DIR=.. \
|
if [ "$$(id -u)" = "0" ]; then \
|
||||||
WORKDIR="$${PWD}"; \
|
dnf -y install git; \
|
||||||
tar \
|
fi; \
|
||||||
--transform "s,^\.,jellyfin-server-$(VERSION)," \
|
version=$$(git describe --tags | sed -e 's/^v//' \
|
||||||
--exclude='.git*' \
|
-e 's/-[0-9]*-g.*$$//' \
|
||||||
--exclude='**/.git' \
|
-e 's/-/~/'); \
|
||||||
--exclude='**/.hg' \
|
SOURCE_DIR=.. \
|
||||||
--exclude='**/.vs' \
|
WORKDIR="$${PWD}"; \
|
||||||
--exclude='**/.vscode' \
|
tar \
|
||||||
--exclude='deployment' \
|
--transform "s,^\.,jellyfin-server-$$version," \
|
||||||
--exclude='**/bin' \
|
--exclude='.git*' \
|
||||||
--exclude='**/obj' \
|
--exclude='**/.git' \
|
||||||
--exclude='**/.nuget' \
|
--exclude='**/.hg' \
|
||||||
--exclude='*.deb' \
|
--exclude='**/.vs' \
|
||||||
--exclude='*.rpm' \
|
--exclude='**/.vscode' \
|
||||||
--exclude='jellyfin-server-$(VERSION).tar.gz' \
|
--exclude=deployment \
|
||||||
-czf "jellyfin-server-$(VERSION).tar.gz" \
|
--exclude='**/bin' \
|
||||||
-C $${SOURCE_DIR} ./
|
--exclude='**/obj' \
|
||||||
cd fedora/; \
|
--exclude='**/.nuget' \
|
||||||
rpmbuild -bs jellyfin.spec \
|
--exclude='*.deb' \
|
||||||
--define "_sourcedir $$PWD/" \
|
--exclude='*.rpm' \
|
||||||
|
--exclude=jellyfin-server-$$version.tar.gz \
|
||||||
|
-czf "jellyfin-server-$$version.tar.gz" \
|
||||||
|
-C $${SOURCE_DIR} ./; \
|
||||||
|
popd; \
|
||||||
|
./bump_version $$version
|
||||||
|
cd fedora/; \
|
||||||
|
rpmbuild -bs jellyfin.spec \
|
||||||
|
--define "_sourcedir $$PWD/" \
|
||||||
--define "_srcrpmdir $(outdir)"
|
--define "_srcrpmdir $(outdir)"
|
||||||
|
|
||||||
|
rpms: fedora/jellyfin-$(shell git describe --tags | sed -e 's/^v//' -e 's/-[0-9]*-g.*$$//' -e 's/-/~/')-1$(shell rpm --eval %dist).src.rpm
|
||||||
|
mock --addrepo=https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ \
|
||||||
|
--enable-network \
|
||||||
|
-r $(TARGET) $<
|
||||||
|
@ -12,7 +12,7 @@ Release: 1%{?dist}
|
|||||||
Summary: The Free Software Media System
|
Summary: The Free Software Media System
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
URL: https://jellyfin.org
|
URL: https://jellyfin.org
|
||||||
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz`
|
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%%{version}.tar.gz`
|
||||||
Source0: jellyfin-server-%{version}.tar.gz
|
Source0: jellyfin-server-%{version}.tar.gz
|
||||||
Source11: jellyfin.service
|
Source11: jellyfin.service
|
||||||
Source12: jellyfin.env
|
Source12: jellyfin.env
|
||||||
|
Loading…
x
Reference in New Issue
Block a user