This repository was archived by the owner on May 2, 2024. It is now read-only.
-
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
6 changed files
with
103 additions
and
52 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,54 @@ | ||
name: Protect Branch CI | ||
# Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
- opened | ||
- reopened | ||
- synchronize | ||
- auto_merge_enabled | ||
branches: | ||
- 'main' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
runner: | ||
name: Run ${{ matrix.workflow_name }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 # default 6 hour | ||
env: | ||
TZ: Asia/Tokyo | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
workflow_name: | ||
- build-imagebuilder | ||
- build-kernel | ||
|
||
steps: | ||
- name: Checkout from repository | ||
uses: actions/[email protected] | ||
|
||
- uses: dorny/[email protected] | ||
id: changes | ||
with: | ||
filters: | | ||
build-imagebuilder: | ||
- '.github/workflows/build-imagebuilder.yml' | ||
- 'config/imagebuilder/disable_services.txt' | ||
- 'config/imagebuilder/files.txt' | ||
- 'config/imagebuilder/packages_list.txt' | ||
build-kernel: | ||
- '.github/workflows/build-kernel.yml' | ||
- 'config/mvebu-cortexa9-fortinet_fg-50e.ini' | ||
- name: Run build imagebuilder | ||
uses: ./.github/workflows/build-imagebuilder.yml | ||
if: steps.changes.outputs.${{ matrix.workflow_name }} == 'true' | ||
|
||
- name: Run build kernel | ||
uses: ./.github/workflows/build-imagebuilder.yml | ||
if: steps.changes.outputs.${{ matrix.workflow_name }} == 'true' |
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 |
---|---|---|
|
@@ -5,42 +5,10 @@ on: | |
schedule: | ||
# https://crontab.guru | ||
# Cache 切れ回避 | ||
- cron: "0 02 * * 1,4" # daily 11:00 +0900 月,木 | ||
|
||
push: | ||
paths: | ||
- .github/workflows/build-imagebuilder.yml | ||
- config/imagebuilder/disable_services.txt | ||
- config/imagebuilder/files.txt | ||
- config/imagebuilder/packages_list.txt | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- closed | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
default: "v23.05.2" | ||
description: OpenWrt version | ||
type: string | ||
|
||
make_options: | ||
required: true | ||
default: "V=c" | ||
description: | | ||
make options. (default: "V=c") | ||
[s]: stdout+stderr, [c]: commands, [w]: warnings/errors only | ||
type: choice | ||
options: | ||
- "V=c" | ||
- "V=w" | ||
- "V=sc" | ||
- "V=sw" | ||
- cron: "0 06 * * 1,4" # daily 14:00 +0900 月,木 | ||
|
||
workflow_call: {} | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
ImageBuilder: | ||
|
@@ -67,7 +35,8 @@ jobs: | |
- name: Confirm git commit SHA output | ||
run: echo ${{ env.COMMIT_SHORT_SHA }} | ||
|
||
- uses: actions/[email protected] | ||
- name: Get last kernel-build runs | ||
uses: actions/[email protected] | ||
id: LastKernelBuild | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -121,7 +90,7 @@ jobs: | |
cp -av ./packages ./imagebuilder/packages | ||
- name: set OpenWrt version | ||
- name: Set OpenWrt version | ||
run: |+ | ||
set -eux | ||
echo "BUILD_OPENWRT_VERSION=$(cat ./version.tag) ($(cat ./version.buildinfo))" >> $GITHUB_ENV | ||
|
@@ -133,9 +102,9 @@ jobs: | |
make image \ | ||
PROFILE="fortinet_fg-50e" \ | ||
DISABLED_SERVICES=\"$(cat ../config/imagebuilder/disable_services.txt | tr '\n' ' ')\" \ | ||
PACKAGES=\"$(cat ../config/imagebuilder/packages_list.txt | tr '\n' ' ')\" \ | ||
FILES=\"$(cat ../config/imagebuilder/files.txt | tr '\n' ' ')\" | ||
DISABLED_SERVICES="$(grep -v -E '^(#|$)' ../config/imagebuilder/disable_services.txt | tr '\n' ' ')" \ | ||
PACKAGES="$(grep -v -E '^(#|$)' ../config/imagebuilder/packages_list.txt | tr '\n' ' ')" \ | ||
FILES=\"../config/imagebuilder/files.txt\" | ||
ls -lah ./bin/targets/mvebu/cortexa9 | ||
|
@@ -173,8 +142,35 @@ jobs: | |
EOF | ||
- name: Cleanup pre-releases | ||
uses: actions/[email protected] | ||
if: github.event.pull_request.merged == true | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: |+ | ||
const prereleases = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 100, | ||
}); | ||
for (const property in prereleases) { | ||
if ( property.draft == true && property.prerelease == true ) { | ||
console.log('delte pre-release ' + property['id'] + '\t' + property['name']) | ||
github.rest.repos.deleteRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: property['id'], | ||
}); | ||
} | ||
} | ||
console.log('end run') | ||
- name: Pre-Release | ||
uses: softprops/action-gh-release@v2 | ||
if: github.event.pull_request.merged == true | ||
with: | ||
name: OpenWrt Custom ${{ env.BUILD_OPENWRT_VERSION }}-${{ env.COMMIT_SHORT_SHA }} | ||
tag_name: ${{ env.BUILD_OPENWRT_VERSION }}-${{ env.COMMIT_SHORT_SHA }} | ||
|
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
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,8 @@ | ||
cat << "EOF" > /etc/uci-defaults/99-custom | ||
uci -q batch << EOI | ||
uci set firewall.@defaults[0].flow_offloading='1' | ||
uci set irqbalance.irqbalance.enabled='1' | ||
uci set system.@system[0].timezone='JST-9' | ||
|
||
EOI | ||
EOF |
Empty file.
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,3 @@ | ||
irqbalance | ||
htop | ||
sysstat |