Skip to content

Commit

Permalink
luci-app-xray
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Jan 22, 2021
0 parents commit 643620e
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Release

on:
push:
tags:
- "v*.*.*"

jobs:
build_release:
runs-on: ubuntu-latest
name: Build and release luci-app-xray
steps:
- name: Build
env:
WORKSPACE: ${{ github.workspace }}
uses: woniuzfb/luci-app-xray@v1
id: build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: '*.ipk'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Done
run: echo "Build complete - ${{ steps.build.outputs.date }}"
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Container image that runs your code
FROM openwrtorg/sdk:aarch64_generic-snapshot

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY build.sh /build.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/build.sh"]
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# luci-app-xray docker action

This action build luci-app-xray with openwrt docker container.

Package name is the same as luci-app-v2ray.

## Outputs

### `date`

The build date.

## Example usage

```bash
env:
WORKSPACE: ${{ github.workspace }}
uses: woniuzfb/luci-app-xray@v1

git push -d origin v2.x.x
git tag -a v2.x.x -f
git push origin v2.x.x

opkg install luci-app-v2ray_2.x.x_all.ipk --force-reinstall
opkg install luci-i18n-v2ray-zh-cn_git-xxxx_all.ipk
```
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# action.yml
name: 'build luci-app-xray'
description: 'build luci-app-xray with openwrt docker container action'
outputs:
date:
description: 'luci-app-xray build date'
runs:
using: 'docker'
image: 'Dockerfile'
25 changes: 25 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh -l

cd /home/build/openwrt || exit 1

cp -f feeds.conf.default feeds.conf
sed -i 's#git.openwrt.org/project/luci#github.com/openwrt/luci#' feeds.conf

test -d "package/luci-app-v2ray" && \
rm -rf "package/luci-app-v2ray"

git clone -b luci2 https://github.com/woniuzfb/luci-app-v2ray.git package/luci-app-v2ray

./scripts/feeds update luci
./scripts/feeds install -a -p luci

make defconfig

make package/luci-app-v2ray/compile V=s

find "bin/packages/" -type f -name "luci-app-v2ray*.ipk" -exec sudo cp -f {} "$WORKSPACE" \;
find "bin/packages/" -type f -name "luci-i18n*.ipk" -exec sudo cp -f {} "$WORKSPACE" \;
find "$WORKSPACE" -type f -name "*.ipk" -exec ls -lh {} \;

date=$(date)
echo "::set-output name=date::$date"

0 comments on commit 643620e

Please sign in to comment.