Skip to content

Commit

Permalink
ci: add ci for creating GitHub Release
Browse files Browse the repository at this point in the history
Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Nov 13, 2023
1 parent adffb20 commit 069e75b
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/image-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Asus Filogic Factory Image

## Supported devices

- TUF-AX4200


## Instructions

1. Download the Factory-Initramfs image.
Place it into a web-server directory root as openwrt.bin.

```
$ mkdir -p /tmp/openwrt-webroot
$ cp <openwrt-factory-initramfs> /tmp/openwrt-webroot/openwrt.bin
$ python3 -m http.server -d /tmp/openwrt-webroot 8080
```

2. Open the router configuration page. Complete the first-time setup wizard.
Enable SSH Access (with Password-Login) on the Router.
Find this Setting at Administration --> System

SSH-Port 22

3. Connect to the device using ssh
```
$ ssh admin@192.168.50.1
```

4. Modify the `/etc/hosts` file using `vi` on the device.
Add an entry to the bottom of the file that resolves to the computer serving the factory-initramfs image.
Name the DNS name `openwrtimage.lan`

5. Transfer the OpenWrt factory-initramfs to the device by downloading it from the http server using wget
```
wget -O /tmp/openwrt.bin http://openwrtimage.lan:8080/openwrt.bin
```

7. Erase the linux-partition

```
$ mtd-erase -d linux
```


8. Write OpenWrt to the `linux` partition

```
$ mtd-write -i /tmp/openwrt.bin -d linux
```

9. Power-Cycle your router.

10. Transfer the OpenWrt sysupgrade image to the router using `scp`.

```
$ scp -O /path/to/<openwrt-sysupgrade.bin> root@192.168.1.1:/tmp
```

11. Install OpenWrt persistently using `sysupgrade`.

```
$ sysupgrade -n /tmp/<openwrt-sysupgrade.bin>
```
4 changes: 4 additions & 0 deletions .github/image.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_filogic=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_asus_tuf-ax4200=y
75 changes: 75 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and release images

on:
push:
pull_request:

jobs:
build:
name: Build images
runs-on: ubuntu-latest

container: ghcr.io/openwrt/tools:openwrt-23.05

permissions:
contents: read
packages: read

steps:
- name: Checkout master directory
uses: actions/checkout@v3
with:
path: openwrt

- name: Restore config
working-directory: openwrt
run: cp .github/image.config .config

- name: Fix permission
run: chown -R buildbot:buildbot openwrt

- name: Run make defconfig
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: make defconfig

- name: Build everything
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: build-output
path: openwrt/bin/targets/mediatek/filogic


release:
name: Create Release
needs: build
if: github.ref_type == 'tag'
runs-on: ubuntu-latest

permissions:
contents: write
packages: read

steps:
- name: Checkout master directory
uses: actions/checkout@v3
with:
path: openwrt

- name: Download build output
uses: actions/download-artifact@v3
with:
name: build-output
path: build-output

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}/openwrt/.github/image-readme.md
files: |
build-output/openwrt-*-initramfs-kernel.bin

0 comments on commit 069e75b

Please sign in to comment.