Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Update packages_list.txt (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
naa0yama authored Mar 10, 2024
1 parent 2cbd9b8 commit c082a78
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 52 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/_protect-branch.yml
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'
78 changes: 37 additions & 41 deletions .github/workflows/build-imagebuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/build-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ on:
# Cache 切れ回避
- cron: "0 02 * * 1,4" # daily 11:00 +0900 月,木

push:
paths:
- .github/workflows/build-kernel.yml
- config/mvebu-cortexa9-fortinet_fg-50e.ini

pull_request:
types:
- opened
- synchronize
- closed

workflow_call: {}
workflow_dispatch:
inputs:
version:
Expand Down
8 changes: 8 additions & 0 deletions config/imagebuilder/files.cfg
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 removed config/imagebuilder/files.txt
Empty file.
3 changes: 3 additions & 0 deletions config/imagebuilder/packages_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
irqbalance
htop
sysstat

0 comments on commit c082a78

Please sign in to comment.