-
-
Notifications
You must be signed in to change notification settings - Fork 96
47 lines (46 loc) · 1.8 KB
/
build_pkg.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: FreeBSD pkg Package Build
on:
workflow_call:
jobs:
pkg:
strategy:
matrix:
version: [13.4, 14.1]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: java_info
uses: YunaBraska/java-info-action@main
- uses: actions/download-artifact@v4
with:
name: maven-dist
path: target/
- name: Replace pkg version
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
sed -i "s/<version>/v${{ env.PBH_VERSION }}/g" pkg/pkg/+MANIFEST
env:
PBH_VERSION: ${{ steps.java_info.outputs.project_version }}
- name: Build FreeBSD pkg
uses: vmactions/freebsd-vm@v1
with:
usesh: true
release: ${{ matrix.version }}
run: |
mkdir -p pkg/pkg/work-dir/usr/local/lib/peerbanhelper
mkdir -p pkg/pkg/work-dir/usr/local/var/db/peerbanhelper/
mv target/libraries pkg/pkg/work-dir/usr/local/lib/peerbanhelper/
cp target/PeerBanHelper.jar pkg/pkg/work-dir/usr/local/lib/peerbanhelper/
(cd pkg/pkg/work-dir/ && find -d * \! -type d) | sort | sed -e "s/.*/\/&/" >> pkg/pkg/pkg-plist
pkg create -m pkg/pkg/ -r pkg/pkg/work-dir -p pkg/pkg/pkg-plist -o pkg/
pkg info -F pkg/peerbanhelper-v${{ env.PBH_VERSION }}.pkg
mv pkg/peerbanhelper-v${{ env.PBH_VERSION }}.pkg pkg/peerbanhelper-v${{ env.PBH_VERSION }}-$(uname -o)-$(uname -r).pkg
env:
PBH_VERSION: ${{ steps.java_info.outputs.project_version }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd-pkg-${{ matrix.version }}-dist
path: |
pkg/*.pkg