Skip to content

Compile Official test #66

Compile Official test

Compile Official test #66

#
# Copyright (c) 2019-2021 P3TERX <https://p3terx.com>
# Modified by guhill1 2022-2024
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# https://github.com/guhill1/auto-build-openwrt/
# Description: compile openwrt firmware by GitHub action
name: Compile Official test
on:
#repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
env:
REPO_URL: https://github.com/openwrt/openwrt
REPO_BRANCH: main
FEEDS_CONF: official/feeds.conf.default
CONFIG_FILE: official/.config
FILES: official/files
DIST_NAME: openwrt
# files for patch
FILES_PAT: official/files_pat
DIY_P1_SH: diy-part1.sh
DIY_P2_SH: diy-part2_of.sh
UPLOAD_BIN_DIR: false
UPLOAD_FIRMWARE: true
UPLOAD_COWTRANSFER: false
UPLOAD_WETRANSFER: false
UPLOAD_RELEASE: false
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo chown $USER:$GROUPS $GITHUB_WORKSPACE
- name: Load custom feeds
run: |
chmod +x $DIY_P1_SH
mkdir openwrt
cd openwrt
$GITHUB_WORKSPACE/$DIY_P1_SH
- name: Load custom configuration
run: |
[ -e $FILES ] && mv $FILES openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x $DIY_P2_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P2_SH
- name: Download package
id: package
shell: bash
run: |
[ -e $FILES ] && mv -v $FILES openwrt/files
[ -e $FILES_PAT ] && cp -R -v $FILES_PAT/* openwrt
echo "aaa=$DIST_NAME" >> $GITHUB_OUTPUT
echo "Pwsh version: ${{ steps.package.outputs.aaa }}"
echo "Bash version: ${{ steps.package.outputs.aaa }}"
- name: Print version from file to console
id: write-content
shell: bash
run: |
echo "Pwsh version: ${{ steps.package.outputs.aaa }}"
echo "Bash version: ${{ steps.package.outputs.aaa }}"
- name: Upload firmware directory
uses: actions/upload-artifact@main
with:
name: $DIST_NAME_${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.DIST_NAME }}