Skip to content

Commit 22993a7

Browse files
committed
Add GitHub CI
1 parent 14a0871 commit 22993a7

File tree

14 files changed

+765
-37
lines changed

14 files changed

+765
-37
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/build.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
name: Build and publish
1+
name: Build
22
on:
33
workflow_dispatch:
4+
push:
5+
paths-ignore:
6+
- 'VERSION'
7+
48
jobs:
59
build:
610
runs-on: ubuntu-latest
711
steps:
812
- name: Checkout
9-
uses: actions/checkout@v2
10-
- name: Set variables
11-
run: echo "VERSION=$(date +%Y%m%d-%H%M)" >> $GITHUB_ENV
12-
- name: Fix permission
13-
run: sudo chown -R root:root ./dpkg
14-
- name: Build dpkg
15-
run: dpkg-deb --build ./dpkg
16-
- name: Release
17-
uses: ncipollo/release-action@v1
13+
uses: actions/checkout@v3
1814
with:
19-
artifacts: './dpkg.deb'
20-
token: ${{ secrets.GITHUB_TOKEN }}
21-
tag: ${{ env.VERSION }}
22-
bodyFile: './README.md'
23-
commit: main
15+
submodules: recursive
16+
- name: Install dependency
17+
run: |
18+
sudo gem i fpm -f
19+
- name: Build
20+
run: make

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- 'VERSION'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: recursive
16+
- name: Install dependency
17+
run: |
18+
sudo gem i fpm -f
19+
- name: Build
20+
run: make
21+
- name: Generate environmental variables
22+
run: |
23+
echo "tag_name=$(cat VERSION)" >> $GITHUB_ENV
24+
echo "name=$(cat NAME)_$(cat VERSION)" >> $GITHUB_ENV
25+
- name: Release
26+
id: release
27+
uses: softprops/action-gh-release@v1
28+
with:
29+
tag_name: ${{ env.tag_name }}
30+
body_path: README.md
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
target_commitish: main
33+
draft: false
34+
files: |
35+
VERSION
36+
${{ env.name }}_*.deb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.deb

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MAKEFLAGS += --silent
2+
3+
NAME = $(shell cat NAME)
4+
VERSION = $(shell cat VERSION)
5+
URL = https://github.com/radxa-pkg/radxa-usbnet
6+
DESCRIPTION = Enable USB ethernet gadget on selected Radxa single board computers
7+
8+
all:
9+
fpm -s dir -t deb -n $(NAME) -v $(VERSION) \
10+
-p $(NAME)_$(VERSION)_all.deb \
11+
--deb-priority optional --category utils \
12+
--before-remove prerm.sh \
13+
--force \
14+
--deb-field "Multi-Arch: foreign" \
15+
--deb-field "Replaces: $(NAME)" \
16+
--deb-field "Conflicts: $(NAME)" \
17+
--deb-field "Provides: $(NAME)" \
18+
--url $(URL) \
19+
--description "$(DESCRIPTION)" \
20+
--license "GPL-2+" \
21+
-m "Radxa <[email protected]>" \
22+
--vendor "Radxa" \
23+
-a all \
24+
./root/=/

NAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
radxa-usbnet

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# radxa-usbnet
2-
Enable USB ethernet gadget on selected Radxa single board computers.
32

4-
# Install
5-
Install with `sudo apt install radxa-usbnet`. Alternatively download the [latest release](https://github.com/RadxaYuntian/radxa-usbnet/releases/latest) and install with `sudo apt install ./dpkg.deb`.
3+
[![Build](https://github.com/radxa-pkg/radxa-usbnet/actions/workflows/build.yml/badge.svg)](https://github.com/radxa-pkg/radxa-usbnet/actions/workflows/build.yml) [![Release](https://github.com/radxa-pkg/radxa-usbnet/actions/workflows/release.yml/badge.svg)](https://github.com/radxa-pkg/radxa-usbnet/actions/workflows/release.yml)
4+
5+
Enable USB ethernet gadget on selected Radxa single board computers
66

77
# Usage
88
This service conflicts with `amlogic-adbd`. As such please run the following command to enable it:
99
```
1010
sudo systemctl disable amlogic-adbd
1111
sudo systemctl enable radxa-usbnet
12-
sudo reboot # need to reboot to free the USB resource
13-
```
12+
```
13+
The device will be available after reboot.

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.2-1

dpkg/DEBIAN/changelog

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)