|
| 1 | +name: 自动验残服务发布 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - avd_serviceV* |
| 7 | + |
| 8 | +jobs: |
| 9 | + release: |
| 10 | + name: 自动验残服务发布 |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + os: [ "ubuntu-latest" ] #, "macos-latest", "windows-latest" |
| 16 | + steps: |
| 17 | + - name: 克隆代码 |
| 18 | + uses: actions/checkout@v3 |
| 19 | + - name: 创建发行版本 |
| 20 | + id: create_release |
| 21 | + uses: actions/create-release@v1 |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 24 | + with: |
| 25 | + tag_name: ${{ github.ref }} |
| 26 | + release_name: ${{ github.ref }} |
| 27 | + body_path: README.md |
| 28 | + draft: false |
| 29 | + prerelease: false |
| 30 | + |
| 31 | + amd64_job: |
| 32 | + name: 自动验残服务打包 |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + os: [ "ubuntu-latest" ] # "ubuntu-18.04", "windows-latest","macos-latest" |
| 38 | + steps: |
| 39 | + - name: 下载代码 |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + repository: jadehh/AutoValidDamage |
| 43 | + ref: avd_service |
| 44 | + path: code |
| 45 | + token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT |
| 46 | + - name: 编译打包 |
| 47 | + uses: addnab/docker-run-action@v3 |
| 48 | + with: |
| 49 | + image: jadehh/python:3.8.16-ubuntu18.04 |
| 50 | + options: -v ${{ github.workspace }}/code:/code |
| 51 | + run: | |
| 52 | + pip install --upgrade pip |
| 53 | + cd code |
| 54 | + pip install -r requirements.txt |
| 55 | + pip uninstall -y numpy |
| 56 | + pip uninstall -y opencv-python |
| 57 | + python packing_app.py \ |
| 58 | + --extra_sys_str /usr/local/site-packages,/usr/local/opencv \ |
| 59 | + --head_str "import PIL\n" \ |
| 60 | + --exclude_files libbz2.so.1.0 \ |
| 61 | + --is_exec True |
| 62 | + - name: 发布 |
| 63 | + uses: softprops/action-gh-release@v1 |
| 64 | + if: startsWith(github.ref, 'refs/tags/') |
| 65 | + with: |
| 66 | + files: |
| 67 | + "./code/Output/*" |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GH_PAT }} # 给最高的权限 |
| 70 | + |
| 71 | + |
0 commit comments