Browse Source

add pyinstall_package.yml

liuyuqi-dellpc 1 year ago
parent
commit
63933528d2
2 changed files with 95 additions and 0 deletions
  1. 34 0
      flutter/README.md
  2. 61 0
      python/.github/workflows/pyinstall_package.yml

+ 34 - 0
flutter/README.md

@@ -17,3 +17,37 @@ docker build  -f .devcontainer/Dockerfile2 -t jianboy/flutter-dev-container:3.13
 docker push jianboy/flutter-dev-container:3.13.5
 
 ```
+
+
+```
+      - uses: gradle/gradle-build-action@v2
+        with:
+          arguments: publishToMavenLocal
+```
+
+
+
+rclone 
+
+```
+    # Setup Rclone
+    - name: Setup Rclone
+      uses: AnimMouse/setup-rclone@v1
+      with:
+        rclone_config: ${{ secrets.RCLONE_CONFIG }}
+
+    # # Sync from Tencent COS
+    - name: Rclone Sync 
+      run: |
+          rclone copy TencentCOS:${{ secrets.COS_CDN_BUCKET }} ./ --transfers=8 --checkers=16
+      env:
+        RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
+
+    # Rclone Sync to B2 & R2
+    - name: Rclone Sync 
+      run: |
+          rclone copy ./ Cloudflare:${{ secrets.CF_R2_BUCKET }} --transfers=8 --checkers=16 --exclude=.git/** --exclude=.github/** --exclude=README.md
+          rclone copy ./ Backblaze:${{ secrets.B2_BUCKET }} --transfers=8 --checkers=16 --exclude=.git/** --exclude=.github/** --exclude=README.md
+      env:
+        RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
+```

+ 61 - 0
python/.github/workflows/pyinstall_package.yml

@@ -0,0 +1,61 @@
+name: Publish Installers
+
+on:
+  workflow_dispatch: ~
+  push:
+    branches: [master]
+    tags: [v*]
+
+jobs:
+  build:
+    name: Build ${{ matrix.os }} Package
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [windows-2019, ubuntu-20.04]
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v4
+
+      - name: Set Release Version
+        id: get_version
+        shell: bash
+        run: |
+          echo "::set-output name=hash::$(git rev-parse --short HEAD)"
+          echo "::set-output name=date::$(date +%Y%m%d)"
+
+      - name: Set Up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: '3.9'
+          cache: pip
+          cache-dependency-path: '**/requirements*.txt'
+
+      - name: Install Dependencies
+        run: |
+          python -m pip install --upgrade pip wheel setuptools
+          pip install -r requirements.txt
+          python -m pip install pyinstaller
+
+      - name: Build Package
+        run: |
+          python -m PyInstaller -F -c  -i favicon.ico --name crawl_github main.py
+
+      # - name: Upload binary
+      #   uses: actions/upload-artifact@v3
+      #   with:
+      #     name: crawl-tool-${{ steps.get_version.outputs.hash }}
+      #     path: |
+      #       dist/
+      #       *.spec
+
+      - name: Update to ali oss
+        uses: yizhoumo/setup-ossutil@v1
+        with:
+          endpoint: oss-cn-qingdao.aliyuncs.com
+          access-key-id: ${{ secrets.OSS_KEY_ID }}
+          access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
+
+      - name: cp files to aliyun
+        run: |
+          ossutil cp -rf dist/ oss://yoqi-software/develop/crawl_github/${{ steps.get_version.outputs.date }}-${{ steps.get_version.outputs.hash }}/