-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
524 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 @@ | ||
git clone --depth 1 --branch v23.05.3 https://github.com/openwrt/openwrt.git |
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,198 @@ | ||
name: AutoBuild | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
build_mode: | ||
description: 'Build mode' | ||
required: true | ||
default: 'build_pkgs_and_imgs' | ||
type: choice | ||
options: | ||
- build_pkgs_and_imgs | ||
- build_imgs | ||
- build_pkgs | ||
compile_packages: | ||
description: 'Compile packages' | ||
required: false | ||
default: 'A B C etc.' | ||
type: string | ||
no_pages: | ||
description: 'Donot deploy pages' | ||
required: true | ||
default: false | ||
type: boolean | ||
export_dl: | ||
description: 'Export DL' | ||
required: true | ||
default: false | ||
type: boolean | ||
|
||
push: | ||
branches: [ master ] | ||
paths: | ||
- 'Makefile' | ||
|
||
watch: | ||
types: [started] | ||
|
||
env: | ||
# Release path | ||
release_path: 'releases' | ||
# 删除早期的 packages | ||
DELETE_OLD_PACKAGES: true | ||
# 删除早期的 workflow 任务 | ||
DELETE_OLD_WORKFLOW: true | ||
WORKFLOW_RETAIN_DAYS: 14 | ||
KEEP_RUNS_RECORD: 100 | ||
### End | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
compile: | ||
permissions: | ||
contents: write # To push a branch | ||
strategy: | ||
matrix: | ||
version: [23.05.3] | ||
arch: [ | ||
x86_64, | ||
mips_24kc, | ||
arm_cortex-a7_neon-vfpv4, | ||
aarch64_cortex-a53, | ||
aarch64_cortex-a72, | ||
arm_cortex-a9, | ||
arm_cortex-a15_neon-vfpv4, | ||
mipsel_24kc, | ||
aarch64_generic | ||
] | ||
include: | ||
- usign_id: '53FF2B6672243D28' | ||
- gpg_id: 'A5F2461EC8F6DCAA' | ||
- release_path: 'releases' | ||
- no_img: true | ||
- arch: x86_64 | ||
target: ['x86', '64'] # for imagebuilder | ||
profile: generic # for imagebuilder | ||
no_img: false | ||
uses: ./.github/workflows/compile.yml | ||
with: | ||
build_mode: ${{ inputs.build_mode }} | ||
compiles: ${{ inputs.compile_packages }} | ||
no_img: ${{ matrix.no_img }} | ||
TPATH: ${{ matrix.release_path }} | ||
VERSION: ${{ matrix.version }} | ||
TARGET: ${{ matrix.target[0] }} | ||
SUBTARGET: ${{ matrix.target[1] }} | ||
PROFILE: ${{ matrix.profile }} | ||
ARCH: ${{ matrix.arch }} | ||
USIGN_ID: ${{ matrix.usign_id }} | ||
GPG_ID: ${{ matrix.gpg_id }} | ||
secrets: inherit | ||
|
||
push_packages: | ||
needs: compile | ||
if: (inputs.build_mode == 0 || inputs.build_mode == 'build_pkgs_and_imgs' || inputs.build_mode == 'build_pkgs') && !cancelled() | ||
permissions: | ||
contents: write # To push a branch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'gh-pages' | ||
lfs: false | ||
submodules: false | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
- name: Move artifact | ||
shell: bash | ||
env: | ||
keepdir: '19.07|21.02|22.03' | ||
run: | | ||
if [ "$DELETE_OLD_PACKAGES" == "true" ]; then | ||
find $release_path/* -maxdepth 0 -type d 2>/dev/null | grep -Ev "\b($keepdir)$" | xargs -I{} rm -rf "{}" | ||
fi | ||
mkdir -p $release_path 2>/dev/null | ||
cp -rf OpenWRT-Build-*/*/ $release_path/ | ||
rm -rf OpenWRT-Build-*/ 2>/dev/null | ||
- name: Display structure of downloaded files | ||
working-directory: ${{ env.release_path }} | ||
run: ls -R | ||
- name: Commit and push Packages | ||
env: | ||
Branch: gh-pages | ||
run: | | ||
git config --local user.name "GitHub Action" | ||
git config --local user.email "[email protected]" | ||
#git remote update # include submodules | ||
#git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin $Branch | ||
#git checkout -B $Branch refs/remotes/origin/$Branch | ||
git add $release_path/**/ | ||
git reset HEAD $release_path/**/targets/ | ||
git diff-index --cached --quiet HEAD $release_path/**/packages/**/*.ipk \ | ||
&& git diff-index --cached --quiet HEAD $release_path/**/packages/**/Packages.manifest \ | ||
&& git diff-index --cached --quiet HEAD $release_path/**/*.pub \ | ||
|| (git commit -m "Update packages" && git push) | ||
export_dl: | ||
needs: compile | ||
if: inputs.export_dl == 1 && (inputs.build_mode == 0 || inputs.build_mode == 'build_pkgs_and_imgs' || inputs.build_mode == 'build_pkgs') && !cancelled() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Initialize Environment | ||
run: | | ||
sudo mkdir -p /workdir | ||
sudo chown $USER:$GROUPS /workdir | ||
mkdir -p /workdir/DL | ||
- name: Cache DL dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: /workdir/DL | ||
key: ${{ runner.os }}-OpenWRT-SDK-DL-Cache-Makefile-${{ hashFiles('**/Makefile') }} | ||
restore-keys: | | ||
${{ runner.os }}-OpenWRT-SDK-DL-Cache-Makefile- | ||
- name: Compress DL Cache | ||
run: | | ||
pushd /workdir/DL | ||
tar -cJvf /workdir/DL.txz * --owner=0 --group=0 --no-same-owner --no-same-permissions | ||
popd | ||
- name: Upload DL Cache artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: DL.txz | ||
path: /workdir/DL.txz | ||
retention-days: 1 | ||
|
||
deploy_pages: | ||
needs: [compile, push_packages] | ||
if: inputs.no_pages == 0 && !cancelled() | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
strategy: | ||
matrix: | ||
release_path: ['releases'] | ||
uses: ./.github/workflows/jekyll.yml | ||
with: | ||
destination_path: ${{ matrix.release_path }} | ||
|
||
clean-up-old-workflow: | ||
needs: push_packages | ||
permissions: | ||
contents: read | ||
actions: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete old Workflow Runs | ||
uses: Mattraks/[email protected] | ||
if: env.DELETE_OLD_WORKFLOW == 'true' && !cancelled() | ||
with: | ||
retain_days: ${{ env.WORKFLOW_RETAIN_DAYS }} | ||
keep_minimum_runs: ${{ env.KEEP_RUNS_RECORD }} |
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,21 @@ | ||
name: build_world | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version' | ||
required: true | ||
default: '23.05.3' | ||
type: string | ||
target: | ||
description: 'Device target' | ||
required: true | ||
default: 'x86' | ||
type: string | ||
subtarget: | ||
description: 'Device subtarget' | ||
required: true | ||
default: '64' | ||
type: string | ||
|
Oops, something went wrong.