Openwrt Build Schedule #358
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
name: Openwrt Build Schedule | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 17 * * *" | |
jobs: | |
parallel: | |
strategy: | |
matrix: | |
include: | |
- target: 'x86' | |
config: 'x86_64' | |
- target: 'x86' | |
config: 'x86_64_cloud' | |
- target: 'vplus' | |
config: 'armv8' | |
- target: 'vplus' | |
config: 'armv8_simple' | |
- target: 's905d' | |
config: 'armv8_full' | |
- target: 'r3g' | |
config: 'r3g' | |
- target: 'r3p' | |
config: 'r3p' | |
- target: 'rm2100' | |
config: 'rm2100' | |
uses: codercaizh/openwrt_package/.github/workflows/build.yml@master | |
with: | |
target: ${{ matrix.target }} | |
config: ${{ matrix.config }} | |
retryCount: 2 | |
clean_workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clean workflow | |
uses: Mattraks/[email protected] | |
upgrade_version_file: | |
needs: [parallel] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Upgrade version | |
run: | | |
git config user.name robot | |
git config user.email [email protected] | |
git pull | |
echo -e '# 此文件用于配置编译时使用的openwrt源码版本以及插件版本,若文件或配置不存在,则默认使用最新的代码编译\n# 问:为什么要有这个版本号机制而不是默认就使用最新版本编译\n# 答:由于OP和插件源码更新非常频繁,部分更新可能会导致编译失败,所以需要有一个Release版本机制,记录百分百能够编出来的版本\n# 目前本文件由Workflow定时自动更新' > version.sh | |
echo 'OPENWRT_VER=${{ needs.parallel.outputs.OPENWRT_VER }}' >> version.sh | |
echo 'OPENWRT_COMMIT_ID=${{ needs.parallel.outputs.OPENWRT_COMMIT_ID }}' >> version.sh | |
echo 'OPENWRT_PACKAGES_COMMIT_ID=${{ needs.parallel.outputs.OPENWRT_PACKAGES_COMMIT_ID }}' >> version.sh | |
echo 'PASSWALL_PACKAGE_COMMIT_ID=${{ needs.parallel.outputs.PASSWALL_PACKAGE_COMMIT_ID }}' >> version.sh | |
echo 'SMALL_PACKAGE_COMMIT_ID=${{ needs.parallel.outputs.SMALL_PACKAGE_COMMIT_ID }}' >> version.sh | |
echo 'SMALL_COMMIT_ID=${{ needs.parallel.outputs.SMALL_COMMIT_ID }}' >> version.sh | |
cat version.sh | |
diffInfo=`git diff` | |
if [ "$diffInfo" = "" ]; then | |
echo '当前已是最新版本' | |
exit | |
fi | |
git add . | |
git commit -m "upgrade version to ${{ needs.parallel.outputs.OPENWRT_VER }}" | |
git push --force | |