179 lines (148 loc) · 5.79 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
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
- name: Remove existing content
run: find . -mindepth 1 -maxdepth 1 \( ! -name ".git" -type d -exec rm -fr "{}" \; \) -o \( -type f -exec rm -f "{}" \; \)
- uses: actions/download-artifact@v4
- name: Move .git directory out
shell: bash
run: mv .git ../.git.bak
- 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
- name: Rename gh-pages branch
continue-on-error: true
run: git branch -m gh-pages gh-pages.old
- uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name == 'master' }}
with:
branch: gh-pages
folder: .
commit-message: Upload
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: .