fix workflows (apt/nightly)

This commit is contained in:
Paulchen Panther 2021-12-13 20:07:45 +01:00
parent 17582ac38a
commit a0d4efc10d
2 changed files with 22 additions and 6 deletions

View File

@ -42,7 +42,15 @@ jobs:
tr -d '\n' < .version > temp && mv temp .version tr -d '\n' < .version > temp && mv temp .version
VERSION=$(cat .version) VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo TARBALL_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo TARBALL_VERSION=${VERSION}~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build package - name: Build package
@ -54,12 +62,12 @@ jobs:
-v "${GITHUB_WORKSPACE}:/source:rw" \ -v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \ ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \
/bin/bash -c "cd /source && \ /bin/bash -c "cd /source && \
mkdir -p debian/source && echo '3.0 (native)' > debian/source/format && \ mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && \
dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \ dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \
cp -fr LICENSE debian/copyright && \ cp -fr LICENSE debian/copyright && \
sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \ sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \ sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \
tar -cJf ../hyperion_${{ env.VERSION }}~${{ env.DISTRIBUTION }}.orig.tar.xz . && \ tar -cJf ../hyperion_${{ env.TARBALL_VERSION }}.orig.tar.xz . && \
debuild --no-lintian -uc -us && \ debuild --no-lintian -uc -us && \
cp ../hyperion_* /deploy" cp ../hyperion_* /deploy"

View File

@ -55,7 +55,15 @@ jobs:
echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version
VERSION=$(cat .version) VERSION=$(cat .version)
echo VERSION=${VERSION} >> $GITHUB_ENV echo VERSION=${VERSION} >> $GITHUB_ENV
if [[ $VERSION == *"-"* ]]; then
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo TARBALL_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
else
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
echo TARBALL_VERSION=${VERSION}~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
fi
echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV echo DISTRIBUTION=$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build package - name: Build package
@ -67,12 +75,12 @@ jobs:
-v "${GITHUB_WORKSPACE}:/source:rw" \ -v "${GITHUB_WORKSPACE}:/source:rw" \
ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \ ghcr.io/hyperion-project/${{ matrix.architecture }}:${{ env.DISTRIBUTION }} \
/bin/bash -c "cd /source && \ /bin/bash -c "cd /source && \
mkdir -p debian/source && echo '3.0 (native)' > debian/source/format && \ mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && \
dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \ dch --create --distribution ${{ env.DISTRIBUTION }} --package 'hyperion' -v '${{ env.VERSION }}~${{ env.DISTRIBUTION }}' '${{ github.event.commits[0].message }}' && \
cp -fr LICENSE debian/copyright && \ cp -fr LICENSE debian/copyright && \
sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \ sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \ sed 's/@CMAKE_ENVIRONMENT@/${{ matrix.cmake-environment }}/g' debian/rules.in > debian/rules && \
tar -cJf ../hyperion_${{ env.VERSION }}~${{ env.DISTRIBUTION }}.orig.tar.xz . && \ tar -cJf ../hyperion_${{ env.TARBALL_VERSION }}.orig.tar.xz . && \
debuild --no-lintian -uc -us && \ debuild --no-lintian -uc -us && \
cp ../hyperion_* /deploy" cp ../hyperion_* /deploy"