-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# Tests whether the youtubeUnblock builds properly | ||
|
||
name: "youtubeUnblock build test" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '.editorconfig' | ||
- '.gitignore' | ||
- 'LICENSE' | ||
- 'README.md' | ||
|
||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '.editorconfig' | ||
- '.gitignore' | ||
- 'LICENSE' | ||
- 'README.md' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.gh.outputs.version }} | ||
sha: ${{ steps.gh.outputs.sha }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'openwrt' | ||
|
||
- name: GH | ||
id: gh | ||
env: | ||
REPO: ${{ github.repository }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
echo "version=$(cat youtubeUnblock/Makefile | grep PKG_VERSION | sed 's/PKG_VERSION:=//')" >> $GITHUB_OUTPUT | ||
if [[ "${{ github.event_name }}" != "pull_request" ]]; then | ||
echo "sha=$(echo ${GITHUB_SHA::7})" >> $GITHUB_OUTPUT | ||
else | ||
echo "sha=$(gh api repos/$REPO/commits/main --jq '.sha[:7]')" >> $GITHUB_OUTPUT | ||
fi | ||
build-static: | ||
needs: prepare | ||
name: build-static ${{ matrix.arch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [x86_64] | ||
branch: [latest-stable] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
id: build | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
SHA: ${{ needs.prepare.outputs.sha }} | ||
shell: bash | ||
run: | | ||
make -j$(nproc) | ||
strip -s build/youtubeUnblock | ||
cp -va build/youtubeUnblock . | ||
tar -czvf youtubeUnblock-$VERSION-$SHA-$PLATFORM-static.tar.gz youtubeUnblock youtubeUnblock.service README.md | ||
- name: Upload artifacts | ||
if: steps.build.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: youtubeUnblock-static-${{ matrix.arch }} | ||
path: ./**/youtubeUnblock*.tar.gz | ||
|
||
build-kmod: | ||
needs: prepare | ||
name: build-kmod ${{ matrix.arch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [x86_64] | ||
branch: [latest-stable] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
id: build | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
SHA: ${{ needs.prepare.outputs.sha }} | ||
shell: bash | ||
run: | | ||
make kmake | ||
tar -czvf kmod-youtubeUnblock-$VERSION-$SHA-$PLATFORM-$(uname -r).tar.gz kyoutubeUnblock.ko | ||
- name: Upload artifacts | ||
if: steps.build.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# name: kmod-youtubeUnblock-${{ matrix.arch }}-${{ $(uname -r) }} | ||
path: ./**/kmod-youtubeUnblock*.tar.gz | ||
|
||
build-openwrt: | ||
needs: prepare | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
branch: | ||
- openwrt-23.05 | ||
arch: | ||
- x86_64 | ||
container: | ||
image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.branch }} | ||
options: --user root | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'openwrt' | ||
|
||
- name: Prepare build | ||
env: | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
SHA: ${{ needs.prepare.outputs.sha }} | ||
run: | | ||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$SHA/" youtubeUnblock/Makefile | ||
- name: Build packages | ||
id: build | ||
env: | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
SHA: ${{ needs.prepare.outputs.sha }} | ||
working-directory: /builder | ||
run: | | ||
echo "src-link youtubeUnblock $GITHUB_WORKSPACE" >> feeds.conf | ||
cat feeds.conf | ||
./scripts/feeds update youtubeUnblock | ||
./scripts/feeds install -a -p youtubeUnblock | ||
make defconfig | ||
make package/youtubeUnblock/compile V=s -j$(nproc) | ||
mv $(find ./bin -type f -name 'youtubeUnblock*.ipk') ./youtubeUnblock-$VERSION-$SHA-${{ matrix.arch }}-${{ matrix.branch }}.ipk | ||
- name: Upload packages | ||
if: steps.build.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: youtubeUnblock-${{ matrix.branch }}-${{ matrix.arch }} | ||
path: /builder/youtubeUnblock*.ipk | ||
if-no-files-found: error |
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