Skip to content

Commit

Permalink
Build FreeBSD 13 only version with local-txz-package
Browse files Browse the repository at this point in the history
  • Loading branch information
defanator committed Jun 26, 2023
1 parent 01d3ace commit 93db8b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ jobs:
- name: Build Packages
run: |
make clean local-deb-package local-rpm-package local-txz-package local-apk-package
cp ./build/packages/txz/FreeBSD:13:*/*.pkg ./build/
tar -cf ./build/nginx-agent-snapshots.tar.gz ./build/*.deb ./build/*.rpm ./build/*.pkg ./build/*.apk
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down
32 changes: 14 additions & 18 deletions scripts/packages/packager/local-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ case "$(uname -m)" in
arm64|aarch64) ABIARCH=aarch64 ;;
esac

FREEBSD_DISTROS="FreeBSD:12:${ABIARCH} FreeBSD:13:${ABIARCH}"

cd /nginx-agent/

mkdir -p /staging/usr/local/bin
Expand All @@ -31,21 +29,19 @@ chmod +x /staging/usr/local/etc/rc.d/nginx-agent
git config --global --add safe.directory /nginx-agent
VERSION="$(git describe --match 'v[0-9]*' --abbrev=0 | tr -d 'v')-SNAPSHOT-$(git rev-parse --short HEAD)" envsubst < scripts/packages/manifest > /staging/+MANIFEST

for freebsd_abi in $FREEBSD_DISTROS; do
mkdir -p ./build/packages/txz/"$freebsd_abi"

pkg -o ABI="$freebsd_abi" create --format txz \
-m /staging \
-r /staging \
-p /staging/plist \
-o ./build/packages/txz/"$freebsd_abi"

# Creating symbolic link from txz to pkg. In older versions of pkg the extension would represent the format of the file
# but since version 1.17.0 pkg will now always create a file with the extesion pkg no matter what the format is.
# See 1.17.0 release notes for more info: https://cgit.freebsd.org/ports/commit/?id=e497a16a286972bfcab908209b11ee6a13d99dc9
cd build/packages/txz/"$freebsd_abi"
ln -s nginx-agent-"$(git describe --match 'v[0-9]*' --abbrev=0 | tr -d 'v')"-SNAPSHOT-"$(git rev-parse --short HEAD)".pkg nginx-agent-"$(git describe --match 'v[0-9]*' --abbrev=0 | tr -d 'v')"-SNAPSHOT-"$(git rev-parse --short HEAD)".txz
cd ../../../../
done
mkdir -p ./build

pkg -o ABI="FreeBSD:13:${ABIARCH}" create --format txz \
-m /staging \
-r /staging \
-p /staging/plist \
-o ./build

# Creating symbolic link from txz to pkg. In older versions of pkg the extension would represent the format of the file
# but since version 1.17.0 pkg will now always create a file with the extesion pkg no matter what the format is.
# See 1.17.0 release notes for more info: https://cgit.freebsd.org/ports/commit/?id=e497a16a286972bfcab908209b11ee6a13d99dc9
cd build
ln -s nginx-agent-"$(git describe --match 'v[0-9]*' --abbrev=0 | tr -d 'v')"-SNAPSHOT-"$(git rev-parse --short HEAD)".pkg nginx-agent-"$(git describe --match 'v[0-9]*' --abbrev=0 | tr -d 'v')"-SNAPSHOT-"$(git rev-parse --short HEAD)".txz
cd ../

rm -rf /staging

0 comments on commit 93db8b0

Please sign in to comment.