Changed build system and Github Actions script for build generation. From now on builds will be UPXed. And there will be naked binaries for every (linux nogui) build.

This commit is contained in:
Revertron
2021-04-17 19:06:40 +02:00
parent f16a95f51e
commit bd76b712ad
2 changed files with 26 additions and 17 deletions
+12 -11
View File
@@ -42,7 +42,7 @@ jobs:
## A new version ## A new version
* Various fixes and stability improvements. * Various fixes and stability improvements.
draft: true draft: true
prerelease: true prerelease: false
build-and-upload: build-and-upload:
name: Create and upload builds name: Create and upload builds
@@ -58,16 +58,16 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: install libgtk-dev libwebkit2gtk-4.0 - name: install dependencies
run: |
sudo apt update && sudo apt install libwebkit2gtk-4.0-dev
cargo install cross
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update && sudo apt install libwebkit2gtk-4.0-dev upx
cargo install cross
- name: Build release binaries - name: Build release binaries
run: | run: |
cargo build --release cargo build --release
cargo build --release --no-default-features --target-dir nogui cargo build --release --no-default-features --target-dir nogui
- name: Build Windows release binaries with Edge - name: Build Windows release binaries with Edge web-engine
if: contains(matrix.os, 'windows') if: contains(matrix.os, 'windows')
run: cargo build --release --features "edge" --target-dir edge run: cargo build --release --features "edge" --target-dir edge
- name: Build and package deb packages - name: Build and package deb packages
@@ -80,12 +80,13 @@ jobs:
PKGARCH=armhf contrib/deb/generate.sh PKGARCH=armhf contrib/deb/generate.sh
PKGARCH=arm64 contrib/deb/generate.sh PKGARCH=arm64 contrib/deb/generate.sh
- name: Upload debs - name: Upload bins & debs
if: contains(matrix.os, 'ubuntu') if: contains(matrix.os, 'ubuntu')
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
tag_name="${{ needs.get_version.outputs.project_version }}" tag_name="${{ needs.get_version.outputs.project_version }}"
hub release edit $(find ./bin -type f -name "alfis-*" -printf "-a %p ") -m "" "$tag_name"
hub release edit $(find . -type f -name "*.deb" -printf "-a %p ") -m "" "$tag_name" hub release edit $(find . -type f -name "*.deb" -printf "-a %p ") -m "" "$tag_name"
- name: win_arch - name: win_arch
@@ -137,8 +138,8 @@ jobs:
files: ${{ env.BIN_PATH_EDGE }} alfis.toml README.md LICENSE adblock.txt files: ${{ env.BIN_PATH_EDGE }} alfis.toml README.md LICENSE adblock.txt
dest: ${{ env.ZIP_NAME_EDGE }} dest: ${{ env.ZIP_NAME_EDGE }}
- name: Upload binary - name: Upload zip
id: upload-binary id: upload-zip
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -148,8 +149,8 @@ jobs:
asset_name: ${{ env.ZIP_NAME }} asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip asset_content_type: application/zip
- name: Upload no GUI binary - name: Upload NoGUI zip
id: upload-nogui-binary id: upload-nogui-zip
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+14 -6
View File
@@ -21,18 +21,26 @@ PKGREPLACES=alfis
# PKGREPLACES=alfis-develop # PKGREPLACES=alfis-develop
#fi #fi
mkdir -p bin
TARGET=""
# Building nogui versions only # Building nogui versions only
if [ $PKGARCH = "amd64" ]; then cargo build --release --no-default-features --target x86_64-unknown-linux-musl && cp target/x86_64-unknown-linux-musl/release/alfis ./alfis if [ $PKGARCH = "amd64" ]; then TARGET='x86_64-unknown-linux-musl'
elif [ $PKGARCH = "i686" ]; then cross build --release --no-default-features --target i686-unknown-linux-musl && cp target/i686-unknown-linux-musl/release/alfis ./alfis elif [ $PKGARCH = "i686" ]; then TARGET='i686-unknown-linux-musl'
elif [ $PKGARCH = "mipsel" ]; then cross build --release --no-default-features --target mipsel-unknown-linux-musl && cp target/mipsel-unknown-linux-musl/release/alfis ./alfis elif [ $PKGARCH = "mipsel" ]; then TARGET='mipsel-unknown-linux-musl'
elif [ $PKGARCH = "mips" ]; then cross build --release --no-default-features --target mips-unknown-linux-musl && cp target/mips-unknown-linux-musl/release/alfis ./alfis elif [ $PKGARCH = "mips" ]; then TARGET='mips-unknown-linux-musl'
elif [ $PKGARCH = "armhf" ]; then cross build --release --no-default-features --target armv7-unknown-linux-musleabihf && cp target/armv7-unknown-linux-musleabihf/release/alfis ./alfis elif [ $PKGARCH = "armhf" ]; then TARGET='armv7-unknown-linux-musleabihf'
elif [ $PKGARCH = "arm64" ]; then cross build --release --no-default-features --target aarch64-unknown-linux-musl && cp target/aarch64-unknown-linux-musl/release/alfis ./alfis elif [ $PKGARCH = "arm64" ]; then TARGET='aarch64-unknown-linux-musl'
else else
echo "Specify PKGARCH=amd64,i686,mips,mipsel,armhf,arm64" echo "Specify PKGARCH=amd64,i686,mips,mipsel,armhf,arm64"
exit 1 exit 1
fi fi
cross build --release --no-default-features --target $TARGET
upx target/$TARGET/release/alfis
cp target/$TARGET/release/alfis ./alfis
cp target/$TARGET/release/alfis ./bin/alfis-linux-$PKGARCH-v$PKGVERSION-nogui
echo "Building $PKGFILE" echo "Building $PKGFILE"
mkdir -p /tmp/$PKGNAME/ mkdir -p /tmp/$PKGNAME/