Skip to content

Build and Upload

Build and Upload #62

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 || github.run_id }}-${{ 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: |
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
- 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
- uses: actions/checkout@v4
with:
repository: Entware/ipk-html-indexer
path: ipk-html-indexer
- name: Run 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
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-${{ github.ref_name || github.run_id }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
fetch-depth: 0
sparse-checkout: /index.html
sparse-checkout-cone-mode: false
- name: Rename gh-pages branch and disable sparse-checkout
run: |
git branch -m gh-pages gh-pages.old || true
git sparse-checkout disable
- uses: actions/download-artifact@v4
- name: Move .git directory out
shell: bash
run: mv .git ../.git.bak
- name: Remove existing index.html files
run: find . -type f -name "index.html" -exec rm -f "{}" \;
- name: Generate Directory Listings
uses: jayanta525/github-pages-directory-listing@v4.0.0
with:
FOLDER: .
- name: Fix permissions of index.html files
run: find . -type f -name index.html -exec sudo chown $(id -u):$(id -g) {} \;
- name: Move .git directory back
shell: bash
run: mv ../.git.bak .git
- uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name == 'master' }}
with:
branch: gh-pages
folder: .
commit-message: Uploading builds
single-commit: true
force: true
- run: rm -fr .git
if: ${{ github.ref_name != 'master' }}
- uses: actions/upload-artifact@v4
if: ${{ github.ref_name != 'master' }}
with:
name: upload
path: .