From e4215735f5632ce6f4b9c951bb7b3a3dbfcbec08 Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 16:18:29 +0800 Subject: [PATCH 1/7] Create release.yml --- .github/workflows/release.yml | 108 ++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..df0395b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,108 @@ +name: Release + +on: + release: + types: [published] + branches: [ master ] + +jobs: + + build_assets: + + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.14 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: | + chmod +x build.assets.sh + ./build.assets.sh + + build_android: + + runs-on: ubuntu-latest + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build + run: | + chmod +x build.android.sh + docker run --rm -i -w /app -v $(pwd):/app -e ANDROID_HOME=/usr/local/android_sdk -e GOPROXY=direct lucor/fyne-cross:android-latest /app/build.android.sh + + build_spk: + + runs-on: ubuntu-latest + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Set env + run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} + + - name: Build + run: | + git clone https://github.com/cnlh/spksrc.git ~/spksrc + mkdir ~/spksrc/nps && cp -rf ./* ~/spksrc/nps/ + docker run -itd --name spksrc --env VERSION=$VERSION -e GOPROXY=direct -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash + docker exec -it spksrc /bin/bash -c 'cd /spksrc && make setup && cd /spksrc/spk/npc && make' + cp ~/spksrc/packages/npc_noarch-all_$VERSION-1.spk ./npc_syno.spk + + build_docker: + + runs-on: ubuntu-latest + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Set env + run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push nps + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.nps + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/nps:latest + ${{ secrets.DOCKERHUB_USERNAME }}/nps:$VERSION + - name: Build and push npc + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.npc + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/npc:latest + ${{ secrets.DOCKERHUB_USERNAME }}/npc:$VERSION From a01e0100edfe67e218afdefd595ec407871eaefe Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 16:25:20 +0800 Subject: [PATCH 2/7] fine ci --- .github/workflows/release.yml | 8 -- build.assets.sh | 156 ++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 8 deletions(-) create mode 100755 build.assets.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df0395b..6d22067 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,8 @@ jobs: with: go-version: ^1.14 id: go - - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Get dependencies run: | go get -v -t -d ./... @@ -28,7 +26,6 @@ jobs: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure fi - - name: Build run: | chmod +x build.assets.sh @@ -41,7 +38,6 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Build run: | chmod +x build.android.sh @@ -54,10 +50,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Set env run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} - - name: Build run: | git clone https://github.com/cnlh/spksrc.git ~/spksrc @@ -73,10 +67,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Set env run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} - - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx diff --git a/build.assets.sh b/build.assets.sh new file mode 100755 index 0000000..d5d1aa4 --- /dev/null +++ b/build.assets.sh @@ -0,0 +1,156 @@ +export GOPROXY=direct + +sudo apt-get update +sudo apt-get install gcc-mingw-w64-i686 gcc-multilib +env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.dll cmd/npc/sdk.go +env GOOS=linux GOARCH=386 CGO_ENABLED=1 CC=gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.so cmd/npc/sdk.go +tar -czvf npc_sdk.tar.gz npc_sdk.dll npc_sdk.so npc_sdk.h + +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_amd64_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_386_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf freebsd_386_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf freebsd_amd64_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf freebsd_arm_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_arm_v7_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_arm_v6_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_arm_v5_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_arm64_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_mips64_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_mips64le_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_mipsle_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf linux_mips_client.tar.gz npc conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf windows_386_client.tar.gz npc.exe conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf windows_amd64_client.tar.gz npc.exe conf/npc.conf conf/multi_account.conf + + +CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go + +tar -czvf darwin_amd64_client.tar.gz npc conf/npc.conf conf/multi_account.conf + +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + +CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_arm_v5_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_arm_v6_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + +CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_arm_v7_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_arm64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf freebsd_arm_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf freebsd_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf freebsd_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_mips_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_mips64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_mips64le_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf linux_mipsle_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + + +CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf darwin_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps + + +CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf windows_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe + + +CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go + +tar -czvf windows_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe \ No newline at end of file From 3bed88a75d46115e0fde8c9d091bf4606e481f9c Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 16:45:20 +0800 Subject: [PATCH 3/7] Update release.yml --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d22067..45f9eac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,14 +51,14 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Set env - run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} + run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/} - name: Build run: | git clone https://github.com/cnlh/spksrc.git ~/spksrc mkdir ~/spksrc/nps && cp -rf ./* ~/spksrc/nps/ - docker run -itd --name spksrc --env VERSION=$VERSION -e GOPROXY=direct -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash - docker exec -it spksrc /bin/bash -c 'cd /spksrc && make setup && cd /spksrc/spk/npc && make' - cp ~/spksrc/packages/npc_noarch-all_$VERSION-1.spk ./npc_syno.spk + docker run -d --name spksrc --env VERSION=${{ env.RELEASE_VERSION }} -e GOPROXY=direct -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash + docker exec spksrc /bin/bash -c 'cd /spksrc && make setup && cd /spksrc/spk/npc && make' + cp ~/spksrc/packages/npc_noarch-all_${{ env.RELEASE_VERSION }}-1.spk ./npc_syno.spk build_docker: @@ -68,7 +68,7 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Set env - run: echo ::set-env name=VERSION::${GITHUB_REF#refs/*/} + run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -87,7 +87,7 @@ jobs: push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/nps:latest - ${{ secrets.DOCKERHUB_USERNAME }}/nps:$VERSION + ${{ secrets.DOCKERHUB_USERNAME }}/nps:${{ env.RELEASE_VERSION }} - name: Build and push npc uses: docker/build-push-action@v2 with: @@ -97,4 +97,4 @@ jobs: push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/npc:latest - ${{ secrets.DOCKERHUB_USERNAME }}/npc:$VERSION + ${{ secrets.DOCKERHUB_USERNAME }}/npc:${{ env.RELEASE_VERSION }} From b7d7d9eccc8a04e77752d1f630b695a6e445d79e Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 17:30:36 +0800 Subject: [PATCH 4/7] Update release.yml --- .github/workflows/release.yml | 62 +++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45f9eac..b4cce3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,46 @@ jobs: run: | chmod +x build.assets.sh ./build.assets.sh + - name: Upload + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + freebsd_386_client.tar.gz + freebsd_386_server.tar.gz + freebsd_amd64_client.tar.gz + freebsd_amd64_server.tar.gz + freebsd_arm_client.tar.gz + freebsd_arm_server.tar.gz + linux_386_client.tar.gz + linux_386_server.tar.gz + linux_amd64_client.tar.gz + linux_amd64_server.tar.gz + linux_arm64_client.tar.gz + linux_arm64_server.tar.gz + linux_arm_v5_client.tar.gz + linux_arm_v6_client.tar.gz + linux_arm_v7_client.tar.gz + linux_arm_v5_server.tar.gz + linux_arm_v6_server.tar.gz + linux_arm_v7_server.tar.gz + linux_mips64le_client.tar.gz + linux_mips64le_server.tar.gz + linux_mips64_client.tar.gz + linux_mips64_server.tar.gz + linux_mipsle_client.tar.gz + linux_mipsle_server.tar.gz + linux_mips_client.tar.gz + linux_mips_server.tar.gz + darwin_amd64_client.tar.gz + darwin_amd64_server.tar.gz + windows_386_client.tar.gz + windows_386_server.tar.gz + windows_amd64_client.tar.gz + windows_amd64_server.tar.gz + npc_sdk.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build_android: @@ -42,6 +82,14 @@ jobs: run: | chmod +x build.android.sh docker run --rm -i -w /app -v $(pwd):/app -e ANDROID_HOME=/usr/local/android_sdk -e GOPROXY=direct lucor/fyne-cross:android-latest /app/build.android.sh + - name: Upload + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + android_client.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build_spk: @@ -56,9 +104,17 @@ jobs: run: | git clone https://github.com/cnlh/spksrc.git ~/spksrc mkdir ~/spksrc/nps && cp -rf ./* ~/spksrc/nps/ - docker run -d --name spksrc --env VERSION=${{ env.RELEASE_VERSION }} -e GOPROXY=direct -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash + docker run -id --name spksrc --env VERSION=${{ env.RELEASE_VERSION }} -e GOPROXY=direct -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash docker exec spksrc /bin/bash -c 'cd /spksrc && make setup && cd /spksrc/spk/npc && make' cp ~/spksrc/packages/npc_noarch-all_${{ env.RELEASE_VERSION }}-1.spk ./npc_syno.spk + - name: Upload + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + npc_syno.spk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build_docker: @@ -83,7 +139,7 @@ jobs: with: context: . file: ./Dockerfile.nps - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + platforms: linux/386,linux/amd64,linux/arm,linux/arm64 push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/nps:latest @@ -93,7 +149,7 @@ jobs: with: context: . file: ./Dockerfile.npc - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + platforms: linux/386,linux/amd64,linux/arm,linux/arm64 push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/npc:latest From a8a0a1d65dee28b704a1f76b798e32e3c72d3edc Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Tue, 6 Oct 2020 17:54:12 +0800 Subject: [PATCH 5/7] Update release.yml --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4cce3f..3621a09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,7 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Set env - run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/} + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Build run: | git clone https://github.com/cnlh/spksrc.git ~/spksrc @@ -124,11 +124,18 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Set env - run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/} + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -139,7 +146,7 @@ jobs: with: context: . file: ./Dockerfile.nps - platforms: linux/386,linux/amd64,linux/arm,linux/arm64 + platforms: linux/amd64,linux/arm,linux/arm64 push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/nps:latest @@ -149,7 +156,7 @@ jobs: with: context: . file: ./Dockerfile.npc - platforms: linux/386,linux/amd64,linux/arm,linux/arm64 + platforms: linux/amd64,linux/arm,linux/arm64 push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/npc:latest From d3ce4e74913140fdc9018570822363d067be63a6 Mon Sep 17 00:00:00 2001 From: chenlianghong Date: Wed, 7 Oct 2020 12:07:59 +0800 Subject: [PATCH 6/7] Update README.md Fix Qunhui to Synology --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d425adb..724f0be 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ NPS is a lightweight, high-performance, powerful **intranet penetration** proxy ## Feature - Comprehensive protocol support, compatible with almost all commonly used protocols, such as tcp, udp, http(s), socks5, p2p, http proxy ... -- Full platform compatibility (linux, windows, macos, Qunhui, etc.), support installation as a system service simply. +- Full platform compatibility (linux, windows, macos, Synology, etc.), support installation as a system service simply. - Comprehensive control, both client and server control are allowed. - Https integration, support to convert backend proxy and web services to https, and support multiple certificates. - Just simple configuration on web ui can complete most requirements. From 63ba9774f96cdd785a597b8df7d2e4f0b9811386 Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Wed, 7 Oct 2020 14:44:23 +0800 Subject: [PATCH 7/7] change build status --- README.md | 2 +- README_zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 724f0be..c0f81d0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # NPS ![](https://img.shields.io/github/stars/ehang-io/nps.svg) ![](https://img.shields.io/github/forks/ehang-io/nps.svg) [![Gitter](https://badges.gitter.im/cnlh-nps/community.svg)](https://gitter.im/cnlh-nps/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -[![Build Status](https://travis-ci.org/ehang-io/nps.svg?branch=master)](https://travis-ci.org/ehang-io/nps) +![Release](https://github.com/ehang-io/nps/workflows/Release/badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/ehang-io/nps/total) [README](https://github.com/ehang-io/nps/blob/master/README.md)|[中文文档](https://github.com/ehang-io/nps/blob/master/README_zh.md) diff --git a/README_zh.md b/README_zh.md index a7b62ec..4275d13 100644 --- a/README_zh.md +++ b/README_zh.md @@ -2,7 +2,7 @@ # nps ![](https://img.shields.io/github/stars/ehang-io/nps.svg) ![](https://img.shields.io/github/forks/ehang-io/nps.svg) [![Gitter](https://badges.gitter.im/cnlh-nps/community.svg)](https://gitter.im/cnlh-nps/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -[![Build Status](https://travis-ci.org/ehang-io/nps.svg?branch=master)](https://travis-ci.org/ehang-io/nps) +![Release](https://github.com/ehang-io/nps/workflows/Release/badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/ehang-io/nps/total) [README](https://github.com/ehang-io/nps/blob/master/README.md)|[中文文档](https://github.com/ehang-io/nps/blob/master/README_zh.md)