-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,14 +145,18 @@ jobs: | |
if [[ "$REF" == "refs/tags/v"* ]]; then | ||
tag=$(git describe --tags $(git rev-list --tags --max-count=1)) | ||
version=${tag} | ||
package_version="$(echo $tag | sed 's|v||g')" | ||
else | ||
date=$(git log -1 --format="%cd" --date=short | sed s/-//g) | ||
count=$(git rev-list --count HEAD) | ||
commit=$(git rev-parse --short HEAD) | ||
version="unstable-$date.r${count}.$commit" | ||
package_version="$date.r${count}.$commit" | ||
fi | ||
echo "VERSION=$version" >> $GITHUB_OUTPUT | ||
echo "VERSION=$version" >> $GITHUB_ENV | ||
echo "PACKAGE_VERSION=$package_version" >> $GITHUB_OUTPUT | ||
echo "PACKAGE_VERSION=$package_version" >> $GITHUB_ENV | ||
- name: Get the filename | ||
id: get_filename | ||
|
@@ -215,3 +219,59 @@ jobs: | |
file: ${{ steps.get_filename.outputs.ASSET_NAME }}.zip* | ||
overwrite: true | ||
tag: ${{ github.ref }} | ||
|
||
- name: Build Linux packages | ||
if: ${{ env.GOARM != '5' && env.GOARM != '6' }} | ||
run: | | ||
if [ "$GOARM" != '5' ] && [ "$GOARM" != '6' ];then | ||
sudo apt install -y libarchive-tools rpm | ||
sudo gem install fpm -v 1.15.1 | ||
pushd build || exit 1 | ||
for package_manager in deb rpm pacman; do | ||
fpm -s dir -t "$package_manager" -a $GOARCH --version "$PACKAGE_VERSION" \ | ||
--url 'https://github.com/daeuniverse/daed' --description "daed, A Modern Dashboard For dae." \ | ||
--maintainer "[email protected]" --name daed --license 'MIT AGPL' \ | ||
--package daed-linux-$GOARCH$GOAMD64$GOARM.$package_manager \ | ||
./geoip.dat=/usr/share/daed/geoip.dat ./geosite.dat=/usr/share/daed/geosite.dat \ | ||
./daed.service=/usr/lib/systemd/system/daed.service \ | ||
./${{ steps.get_filename.outputs.ASSET_NAME }}=/usr/bin/daed | ||
done | ||
popd || exit 1 | ||
cp build/daed-linux-$GOARCH$GOAMD64$GOARM.deb installer-${{ steps.get_filename.outputs.ASSET_NAME }}.deb | ||
cp build/daed-linux-$GOARCH$GOAMD64$GOARM.rpm installer-${{ steps.get_filename.outputs.ASSET_NAME }}.rpm | ||
cp build/daed-linux-$GOARCH$GOAMD64$GOARM.pacman installer-${{ steps.get_filename.outputs.ASSET_NAME }}.pkg.tar.zst | ||
ls | grep -E ".deb|.pkg.tar.zst|.rpm" | ||
for package in $(ls | grep -E ".deb|.pkg.tar.zst|.rpm");do | ||
md5sum $package >> $package.dgst | ||
shasum -a 1 $package >> $package.dgst | ||
shasum -a 256 $package >> $package.dgst | ||
shasum -a 512 $package >> $package.dgst | ||
cat $package.dgst | ||
done | ||
fi | ||
- name: Upload artifact - packages | ||
if: ${{ github.event_name != 'release' && env.GOARM != '5' && env.GOARM != '6' }} | ||
uses: nanoufo/[email protected] | ||
with: | ||
path: | | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.deb | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.rpm | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.pkg.tar.zst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.deb.dgst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.rpm.dgst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.pkg.tar.zst.dgst | ||
- name: Upload Linux packages to GitHub release | ||
if: ${{ github.event_name == 'release' && env.GOARM != '5' && env.GOARM != '6' }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.deb | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.rpm | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.pkg.tar.zst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.deb.dgst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.rpm.dgst | ||
installer-${{ steps.get_filename.outputs.ASSET_NAME }}.pkg.tar.zst.dgst | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |