Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(build.yml): fix armv7 packages' architecture #145

Merged
merged 17 commits into from
Jul 16, 2023
Merged
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,37 @@ jobs:
sudo apt install -y libarchive-tools rpm
sudo gem install fpm -v 1.15.1
kunish marked this conversation as resolved.
Show resolved Hide resolved
pushd bundled || exit 1
for package_manager in deb rpm pacman; do
fpm -s dir -t "$package_manager" -a $GOARCH --version "$PACKAGE_VERSION" \
if [ "$GOARCH" == 'mips64' ] || [ "$GOARCH" == 'mips64le' ] || [ "$GOARCH" == 'mipsle' ] || [ "$GOARCH" == 'mips' ];then
echo "Skip pacman package build for Arch Linux has never been port to MIPS family, Debian package and RPM package are enough."
ARCH_PACMAN=''
else
ARCH_PACMAN='pacman'
fi
for package_manager in deb rpm $ARCH_PACMAN; do
if [ "$package_manager" == 'pacman' ];then
if [ "$GOARCH" == 'arm' ] && [ "$GOARM" == '7' ];then
package_arch='arm7hf'
elif [ "$GOARCH" == 'arm64' ];then
package_arch='aarch64'
else
package_arch="$GOARCH"
fi
elif [ "$package_manager" == 'rpm' ];then
if [ "$GOARCH" == 'arm' ] && [ "$GOARM" == '7' ];then
package_arch='armhfp'
elif [ "$GOARCH" == 'arm64' ];then
package_arch='aarch64'
else
package_arch="$GOARCH"
fi
elif [ "$package_manager" == 'deb' ];then
if [ "$GOARCH" == 'arm' ] && [ "$GOARM" == '7' ];then
package_arch='armhf'
else
package_arch="$GOARCH"
fi
fi
fpm -s dir -t "$package_manager" -a $package_arch --version "$PACKAGE_VERSION" \
--url 'https://github.com/daeuniverse/daed' --description "daed, A Modern Dashboard For dae." \
--maintainer "daed@dae.v2raya.org" --name daed --license 'MIT AGPL' \
--package daed-linux-$GOARCH$GOAMD64$GOARM.$package_manager \
Expand All @@ -210,14 +239,25 @@ jobs:
popd || exit 1
cp bundled/daed-linux-$GOARCH$GOAMD64$GOARM.deb installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.deb
cp bundled/daed-linux-$GOARCH$GOAMD64$GOARM.rpm installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.rpm
cp bundled/daed-linux-$GOARCH$GOAMD64$GOARM.pacman installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.pkg.tar.zst
if [ "$ARCH_PACMAN" == 'pacman' ];then
cp bundled/daed-linux-$GOARCH$GOAMD64$GOARM.pacman installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.pkg.tar.zst
fi
ls | grep -E ".deb|.rpm|.pkg.tar.zst"
fi

- name: Upload Linux packages
if: ${{ env.GOARM != '5' && env.GOARM != '6' }}
if: ${{ env.GOARM != '5' && env.GOARM != '6' && env.GOARCH != 'mips' && env.GOARCH != 'mipsle' && env.GOARCH != 'mips64' && env.GOARCH != 'mips64le' }}
MarksonHon marked this conversation as resolved.
Show resolved Hide resolved
uses: nanoufo/action-upload-artifacts-and-release-assets@v1.5
with:
path: |
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.deb
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.rpm
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.pkg.tar.zst

- name: Upload Linux packages without Arch Linux package
if: ${{ env.GOARCH == 'mips' || env.GOARCH == 'mipsle' || env.GOARCH == 'mips64' || env.GOARCH == 'mips64le' }}
uses: nanoufo/action-upload-artifacts-and-release-assets@v1.5
with:
path: |
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.deb
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.rpm