Update build.yml

This commit is contained in:
klzgrad 2021-02-28 19:23:26 +08:00 committed by GitHub
parent b97304f73c
commit f7094779f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ on:
push: push:
branches: [master] branches: [master]
release: release:
types: [published] types: [created]
jobs: jobs:
linux: linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -23,6 +23,20 @@ jobs:
- run: ./build.sh - run: ./build.sh
working-directory: src working-directory: src
- run: ./tests/basic.sh src/out/Release/naive - run: ./tests/basic.sh src/out/Release/naive
- run: |
BUNDLE="naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}"
mkdir $BUNDLE
cp src/out/Release/naive src/config.json LICENSE USAGE.txt $BUNDLE
tar cJf $BUNDLE.tar.xz $BUNDLE
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_name: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_content_type: application/octet-stream
win: win:
runs-on: windows-latest runs-on: windows-latest
defaults: defaults:
@ -43,6 +57,20 @@ jobs:
working-directory: src working-directory: src
- run: ./tests/basic.sh src/out/Release/naive - run: ./tests/basic.sh src/out/Release/naive
if: ${{ matrix.arch != 'arm64' }} if: ${{ matrix.arch != 'arm64' }}
- run: |
BUNDLE="naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}"
mkdir $BUNDLE
cp src/out/Release/naive.exe src/config.json LICENSE USAGE.txt $BUNDLE
7z a $BUILD_NAME.zip $BUILD_NAME
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.zip
asset_name: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.zip
asset_content_type: application/octet-stream
mac: mac:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
@ -60,6 +88,20 @@ jobs:
working-directory: src working-directory: src
- run: ./tests/basic.sh src/out/Release/naive - run: ./tests/basic.sh src/out/Release/naive
if: ${{ matrix.arch != 'arm64' }} if: ${{ matrix.arch != 'arm64' }}
- run: |
BUNDLE="naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}"
mkdir $BUNDLE
cp src/out/Release/naive src/config.json LICENSE USAGE.txt $BUNDLE
tar cJf $BUNDLE.tar.xz $BUNDLE
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_name: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_content_type: application/octet-stream
openwrt: openwrt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@ -104,4 +146,18 @@ jobs:
working-directory: src working-directory: src
- run: ./build.sh - run: ./build.sh
working-directory: src working-directory: src
- run: ./tests/basic.sh src/out/Release/naive - run: ./tests/basic.sh src/out/Release/naive
- run: |
BUNDLE="naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}"
mkdir $BUNDLE
cp src/out/Release/naive src/config.json LICENSE USAGE.txt $BUNDLE
tar cJf $BUNDLE.tar.xz $BUNDLE
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_name: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}.tar.xz
asset_content_type: application/octet-stream