feat: fix and update Makefile #195
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
name: Build Test | |
on: | |
push: | |
branches-ignore: | |
- "releases/v*" | |
tags-ignore: | |
- "*" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SDK_URL_PATH: https://downloads.openwrt.org/snapshots/targets/x86/64 | |
SDK_NAME: -sdk-x86-64_ | |
ARCH: x86_64 | |
CACHE_DIR: ~/cache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache: | |
- name: Setup CCache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.ccache | |
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache: | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -yq gettext libncurses5-dev rsync xsltproc | |
- name: Prepare For Build | |
run: | | |
sdk_home="$(mktemp -d)" | |
test -d ~/.ccache || mkdir -p ~/.ccache | |
ln -sf ~/.ccache "$sdk_home/.ccache" | |
echo "SDK_HOME=$sdk_home" >> $GITHUB_ENV | |
echo "CONFIG_CCACHE=y" >> $GITHUB_ENV | |
- name: Build package | |
env: | |
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }} | |
run: sh compile.sh | |
- name: Show CCache Status | |
run: | | |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s" | |
- name: Save Build Result | |
uses: actions/upload-artifact@v2 | |
with: | |
name: v2ray-core | |
path: | | |
*.ipk | |
retention-days: 7 |