Update Makefile

add CGO support for release build
add release.sh
This commit is contained in:
Larvan2
2023-01-15 01:46:30 +08:00
parent 8a9b3b3d59
commit 2c80155c6f
3 changed files with 107 additions and 8 deletions

View File

@ -10,12 +10,36 @@ on:
- Alpha
- Beta
jobs:
Build:
runs-on: ubuntu-latest
Build-Prerelease:
permissions: write-all
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set variables
if: ${{ github.ref_name }} == Alpha
run: echo "VERSION=master" >> $GITHUB_ENV
shell: bash
- name: Set variables
if: ${{ github.ref_name }} == Beta
run: echo "VERSION=alpha" >> $GITHUB_ENV
shell: bash
- name: Set ENV
run: |
echo "NAME=clash.meta" >> $GITHUB_ENV
echo "BUILD_TIME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
echo "REPO=${{ github.repository }}" >> $GITHUB_ENV
echo "TARGET=windows/*,linux/*,darwin-10.16/*" >> $GITHUB_ENV
echo "TAGS=with_gvisor,with_lwip" >> $GITHUB_ENV
echo "ShortSHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
echo "$ShortSHA"
echo "$REPO"
shell: bash
- name: Setup Go
uses: actions/setup-go@v3
with:
@ -23,17 +47,38 @@ jobs:
check-latest: true
cache: true
- name: Test
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25b
add-to-path: false
- name: Go Test
if: ${{github.ref_name=='Beta'}}
run: |
go test ./...
- name: Set up xgo
run: |
docker pull techknowlogick/xgo:latest
go install src.techknowlogick.com/xgo@latest
- name: Build
if: success()
env:
NAME: Clash.Meta
BINDIR: bin
run: make -j$(($(nproc) + 1)) releases
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
mkdir bin
make android-arm64
make xgoall
cp release.sh ./bin/
cd bin
ls -la
chmod +x *
bash ./release.sh
rm ./release.sh
ls -la
cd ..
- name: Delete current release assets
uses: andreaswilli/delete-release-assets-action@v2.0.0