Skip to content

Build and Upload

Build and Upload #52

Workflow file for this run

name: Build and Upload
on:
workflow_dispatch:
env:
PACKAGES: xupnpd2-fork http-to-https-proxy watchyourlan
PACKAGES_NOHF: http-to-https-proxy watchyourlan
jobs:
build:
concurrency: build-${{ github.ref_name }}-${{ matrix.config }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- config: aarch64-3.10
allow-failure: false
#- config: armv5-3.2 # EOS
# allow-failure: true
#- config: armv7-2.6 # EOS
# allow-failure: true
- config: armv7-3.2
allow-failure: false
- config: mipsel-3.4
allow-failure: true
- config: mips-3.4
allow-failure: true
- config: x64-3.2
allow-failure: false
#- config: x86-2.6 # EOS
# allow-failure: true
steps:
- uses: actions/checkout@v4
with:
repository: Entware/Entware
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential flex gawk gcc-multilib gettext git libncurses5-dev libssl-dev python2 python-is-python3 python3-distutils subversion unzip zlib1g-dev rsync
- name: Activate platform configuration
run: ln -s configs/${{ matrix.config }}.config .config
- name: Get commit hash for cache key
id: hash
run: echo "RESULT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v4
continue-on-error: true
id: restore-cache
with:
path: |
bin
build_dir
staging_dir
key: ${{ matrix.config }}-${{ steps.hash.outputs.RESULT }}
- name: Build tools and toolchain
if: steps.restore-cache.outputs.cache-hit != 'true'
run: |
make tools/install -j$(nproc) ${{ vars.TOOLCHAIN_EXTRA_COMPILE_ARGUMENTS || '' }}
make toolchain/install -j$(nproc) ${{ vars.TOOLCHAIN_EXTRA_COMPILE_ARGUMENTS || '' }}
make target/compile -j$(nproc) ${{ vars.TOOLCHAIN_EXTRA_COMPILE_ARGUMENTS || '' }}
- uses: actions/cache/save@v4
continue-on-error: true
if: steps.restore-cache.outputs.cache-hit != 'true'
with:
path: |
bin
build_dir
staging_dir
key: ${{ matrix.config }}-${{ steps.hash.outputs.RESULT }}
- name: Fetch feeds
run: |
echo "src-git jacklul https://github.com/jacklul/entware-packages.git" >> feeds.conf
make package/symlinks
- name: Build packages
if: env.PACKAGES != ''
continue-on-error: ${{ matrix.allow-failure }}
run: |

Check failure on line 89 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build and Upload

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 89, Col: 12): Unexpected symbol: ':'. Located at position 35 within expression: matrix.allow-failure && '|| true' : '' .github/workflows/build.yml (Line: 96, Col: 12): Unexpected symbol: ':'. Located at position 35 within expression: matrix.allow-failure && '|| true' : ''
for PACKAGE in ${{ env.PACKAGES }}; do echo "CONFIG_PACKAGE_${PACKAGE}=m" >> .config ; done
for PACKAGE in ${{ env.PACKAGES }}; do make package/$PACKAGE/compile -j$(nproc) ${{ vars.PACKAGES_EXTRA_COMPILE_ARGUMENTS || '' }} ${{ matrix.allow-failure && '|| true' : '' }} ; done
- name: Build packages ("nohf" variants)
if: env.PACKAGES_NOHF != '' && (matrix.config == 'armv7-2.6' || matrix.config == 'armv7-3.2')
continue-on-error: ${{ matrix.allow-failure }}
run: |
for PACKAGE in ${{ env.PACKAGES_NOHF }}; do echo "CONFIG_PACKAGE_${PACKAGE}_nohf=m" >> .config ; done
for PACKAGE in ${{ env.PACKAGES_NOHF }}; do BUILD_VARIANT=nohf make package/$PACKAGE/compile -j$(nproc) ${{ vars.PACKAGES_EXTRA_COMPILE_ARGUMENTS || '' }} ${{ matrix.allow-failure && '|| true' : '' }} ; done
- uses: actions/checkout@v4
with:
repository: Entware/ipk-html-indexer
path: ipk-html-indexer
- name: Setup ipk-html-indexer
run: |
sudo ln -sv "$GITHUB_WORKSPACE/ipk-html-indexer/mkindex.py" /usr/local/bin/mkindex.py
sudo ln -sv "$GITHUB_WORKSPACE/ipk-html-indexer/mkhtml.py" /usr/local/bin/mkhtml.py
- name: Copy packages to artifact directory
run: |
mkdir -v artifact
for PACKAGE in ${{ env.PACKAGES }}; do cp -fv bin/targets/*/*/packages/$PACKAGE* artifact || true; done
- name: Run ipk-html-indexer
run: |
bash ipk-html-indexer/index_feed.sh -h -f artifact
sed 's#href="/css#href="css#' -i artifact/Packages.html
cp -rfv ipk-html-indexer/css artifact
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config }}
path: artifact/*
retention-days: 1
upload:
concurrency: upload
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
sparse-checkout: index.html
sparse-checkout-cone-mode: false
- name: Rename gh-pages branch
run: git branch -m gh-pages gh-pages.old
continue-on-error: true
- name: Disable sparse-checkout
run: git sparse-checkout disable
- uses: actions/download-artifact@v3
- name: Create index.html
run: |
rm -f index.html
find . -maxdepth 1 -type d -not -name ".git" -not -name "." -exec sh -c 'echo "<a href=\"$(basename {})/Packages.html\">$(basename {})</a><br>" >> index.html' \;
- uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: .
commit-message: Uploading builds
single-commit: true
force: true