build action
This commit is contained in:
parent
04fd45fe97
commit
17ea78a32d
60
.github/workflows/build.yml
vendored
Normal file
60
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
name: Build and Package OPKG
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [mips, mipsle, arm, arm64]
|
||||||
|
include:
|
||||||
|
- arch: mips
|
||||||
|
goarch: mips
|
||||||
|
gomips: softfloat
|
||||||
|
- arch: mipsle
|
||||||
|
goarch: mipsle
|
||||||
|
gomips: softfloat
|
||||||
|
- arch: arm
|
||||||
|
goarch: arm
|
||||||
|
- arch: arm64
|
||||||
|
goarch: arm64
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.21'
|
||||||
|
|
||||||
|
- name: Build binary
|
||||||
|
run: |
|
||||||
|
GOOS=linux GOARCH=${{ matrix.goarch }} GOMIPS=${{ matrix.gomips }} go build -o kvas2-${{ matrix.arch }}
|
||||||
|
|
||||||
|
- name: Package as OPKG
|
||||||
|
run: |
|
||||||
|
mkdir -p build/${{ matrix.arch }}/control
|
||||||
|
echo 'Package: kvas2' > build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Version: 0.0.1' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Architecture: ${{ matrix.arch }}' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Maintainer: Vladimir Avtsenov <vladimir.lsk.cool@gmail.com>' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Description: kvas2' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Section: base' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Priority: optional' >> build/${{ matrix.arch }}/control/control
|
||||||
|
echo 'Depends: libc, iptables, socat' >> build/${{ matrix.arch }}/control/control
|
||||||
|
mkdir -p build/${{ matrix.arch }}/data/opt/usr/bin
|
||||||
|
cp kvas2-${{ matrix.arch }} build/${{ matrix.arch }}/data/opt/usr/bin/kvas2
|
||||||
|
cp -r opt build/${{ matrix.arch }}/data/
|
||||||
|
chmod +x build/${{ matrix.arch }}/data/usr/bin/kvas2
|
||||||
|
fakeroot sh -c "tar -C build/${{ matrix.arch }}/control -cvf build/${{ matrix.arch }}/control.tar ."
|
||||||
|
fakeroot sh -c "tar -C build/${{ matrix.arch }}/data -cvf build/${{ matrix.arch }}/data.tar ."
|
||||||
|
echo '2.0' > build/${{ matrix.arch }}/debian-binary
|
||||||
|
ar r build/kvas2_${{ matrix.arch }}.ipk build/${{ matrix.arch }}/debian-binary build/${{ matrix.arch }}/control.tar build/${{ matrix.arch }}/data.tar
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: kvas2_${{ matrix.arch }}.ipk
|
||||||
|
path: build/kvas2_${{ matrix.arch }}.ipk
|
Loading…
x
Reference in New Issue
Block a user