forked from Haris131/boot-mod-sdcard
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
|
||
name: Boot Mod SDCard | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type_file: | ||
description: "Select type file" | ||
required: false | ||
default: "img.xz" | ||
type: choice | ||
options: | ||
- img.xz | ||
- img.gz | ||
img_url: | ||
description: "Set the URL of the image file" | ||
required: true | ||
default: "" | ||
|
||
env: | ||
TZ: Asia/Jakarta | ||
|
||
jobs: | ||
build-b860h: | ||
runs-on: ubuntu-20.04 | ||
name: Build for b860h | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Setup Environment | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -y wget python3 | ||
sudo pip3 install gdown git+https://github.com/Juvenal-Yescas/mediafire-dl | ||
- name: Download firmware | ||
run: | | ||
mkdir -p /workdir/openwrt | ||
if [[ "${{ github.event.inputs.img_url }}" == *"drive."* ]]; then | ||
gdown ${{ github.event.inputs.img_url }} -O /workdir/openwrt/firmware.${{ github.event.inputs.type_file }} | ||
else | ||
wget ${{ github.event.inputs.img_url }} -O /workdir/openwrt/firmware.${{ github.event.inputs.type_file }} | ||
fi | ||
- name: Process firmware for b860h | ||
run: | | ||
cd /workdir/openwrt | ||
if [[ "${{ github.event.inputs.type_file }}" == "img.gz" ]]; then | ||
gunzip firmware.img.gz | ||
else | ||
unxz firmware.img.xz | ||
fi | ||
# Additional processing for b860h | ||
mv firmware.img firmware-b860h.img | ||
- name: Compress and Upload | ||
run: | | ||
cd /workdir/openwrt | ||
if [[ "${{ github.event.inputs.type_file }}" == "img.gz" ]]; then | ||
gzip firmware-b860h.img | ||
else | ||
xz firmware-b860h.img | ||
fi | ||
echo "Firmware for b860h built successfully." | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: /workdir/openwrt/firmware-b860h.${{ github.event.inputs.type_file }} | ||
tag: ${{ github.ref }} | ||
release_name: "b860h Firmware" | ||
|
||
build-hg680p: | ||
runs-on: ubuntu-20.04 | ||
name: Build for hg680p | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Setup Environment | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -y wget python3 | ||
sudo pip3 install gdown git+https://github.com/Juvenal-Yescas/mediafire-dl | ||
- name: Download firmware | ||
run: | | ||
mkdir -p /workdir/openwrt | ||
if [[ "${{ github.event.inputs.img_url }}" == *"drive."* ]]; then | ||
gdown ${{ github.event.inputs.img_url }} -O /workdir/openwrt/firmware.${{ github.event.inputs.type_file }} | ||
else | ||
wget ${{ github.event.inputs.img_url }} -O /workdir/openwrt/firmware.${{ github.event.inputs.type_file }} | ||
fi | ||
- name: Process firmware for hg680p | ||
run: | | ||
cd /workdir/openwrt | ||
if [[ "${{ github.event.inputs.type_file }}" == "img.gz" ]]; then | ||
gunzip firmware.img.gz | ||
else | ||
unxz firmware.img.xz | ||
fi | ||
# Additional processing for hg680p | ||
mv firmware.img firmware-hg680p.img | ||
- name: Compress and Upload | ||
run: | | ||
cd /workdir/openwrt | ||
if [[ "${{ github.event.inputs.type_file }}" == "img.gz" ]]; then | ||
gzip firmware-hg680p.img | ||
else | ||
xz firmware-hg680p.img | ||
fi | ||
echo "Firmware for hg680p built successfully." | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: /workdir/openwrt/firmware-hg680p.${{ github.event.inputs.type_file }} | ||
tag: ${{ github.ref }} | ||
release_name: "hg680p Firmware" |