Skip to content

Commit

Permalink
fix(ci): fix variable interpolation in publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowghost committed Mar 1, 2022
1 parent 0277d37 commit 2214a90
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,24 @@ jobs:
key: ${{ secrets.deploy-key }}
script_stop: true
script: |-
version="${github.release.tag_name#v}"
basename="jellyfin-ffmpeg_${version}-${matrix.arrays.codename}"
if [ "${matrix.distro}" != "windows" ]; then
sudo find /srv/repository/releases/server/${matrix.arrays.distro}/ -type l -name "jellyfin-ffmpeg_*" -exec rm {} \;
find /srv/repository/releases/server/${matrix.arrays.distro}/versions/jellyfin-ffmpeg/${version} -type f -name "${basename}_*.deb" | while read file; do
reprepro -b /srv/repository/${matrix.distro} --export=never --keepunreferencedfiles includedeb ${matrix.arrays.codename} ${file}
tag="${{ github.release.tag_name }}"
version="${tag#v}"
basename="jellyfin-ffmpeg_${version}-${{ matrix.arrays.codename }}"
if [ "${{ matrix.arrays.distro }}" != "windows" ]; then
sudo find /srv/repository/releases/server/${{ matrix.arrays.distro }}/ -type l -name "jellyfin-ffmpeg_*" -exec rm {} \;
find /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} -type f -name "${basename}_*.deb" | while read file; do
reprepro -b /srv/repository/${{ matrix.arrays.distro }} --export=never --keepunreferencedfiles includedeb ${{ matrix.arrays.codename }} ${file}
done
sudo find /srv/repository/releases/server/${matrix.distro}/ -type l -name "${basename}_*" -exec rm {} \;
reprepro -b /srv/repository/${matrix.distro} deleteunreferenced
reprepro -b /srv/repository/${matrix.distro} export
sudo rm -f /srv/repository/releases/server/${matrix.distro}/{stable,stable-pre,unstable}/ffmpeg
sudo ln -fs /srv/repository/releases/server/${matrix.distro}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${matrix.distro}/stable/ffmpeg
sudo ln -fs /srv/repository/releases/server/${matrix.distro}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${matrix.distro}/stable-pre/ffmpeg
sudo ln -fs /srv/repository/releases/server/${matrix.distro}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${matrix.distro}/unstable/ffmpeg
sudo find /srv/repository/releases/server/${{ matrix.arrays.distro }}/ -type l -name "${basename}_*" -exec rm {} \;
reprepro -b /srv/repository/${{ matrix.arrays.distro }} deleteunreferenced
reprepro -b /srv/repository/${{ matrix.arrays.distro }} export
sudo rm -f /srv/repository/releases/server/${{ matrix.arrays.distro }}/{stable,stable-pre,unstable}/ffmpeg
sudo ln -fs /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${{ matrix.arrays.distro }}/stable/ffmpeg
sudo ln -fs /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${{ matrix.arrays.distro }}/stable-pre/ffmpeg
sudo ln -fs /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${{ matrix.arrays.distro }}/unstable/ffmpeg
else
sudo rm -f /srv/repository/releases/server/${matrix.distro}/ffmpeg
sudo ln -fs /srv/repository/releases/server/${matrix.distro}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${matrix.distro}/ffmpeg
sudo rm -f /srv/repository/releases/server/${{ matrix.arrays.distro }}/ffmpeg
sudo ln -fs /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} /srv/repository/releases/server/${{ matrix.arrays.distro }}/ffmpeg
fi
sudo chown -R root:adm /srv/repository/${matrix.distro}
sudo chmod -R g+w /srv/repository/${matrix.distro}
sudo chown -R root:adm /srv/repository/${{ matrix.arrays.distro }}
sudo chmod -R g+w /srv/repository/${{ matrix.arrays.distro }}

0 comments on commit 2214a90

Please sign in to comment.