From 05f595ffdefb0f138d1eb41dc6d06154a39ecf6f Mon Sep 17 00:00:00 2001 From: zhouyangtingwen <130919942+zhouyangtingwen@users.noreply.github.com> Date: Wed, 19 Apr 2023 01:39:03 +0800 Subject: [PATCH] update workflows --- .github/workflows/main.yml | 138 ++++++++----------------------------- 1 file changed, 30 insertions(+), 108 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22869d7..4948b9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,118 +1,40 @@ -name: Release CI - +name: "publish" on: push: branches: - - release # Push events to matching v*, i.e. v1.0, v20.15.10 + - master jobs: - build-chatgptstacks: - runs-on: ${{ matrix.os }} + publish-tauri: strategy: fail-fast: false matrix: - include: - - build: macos - os: macos-latest - arch: x86_64 - target: x86_64-apple-darwin - - build: macos - os: macos-latest - arch: aarch64 - target: aarch64-apple-darwin - - build: windows - os: windows-latest - arch: x86_64 - target: x86_64-pc-windows-msvc - - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 14 - - - name: 'Setup Rust' - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} - - - name: Install xattr (macos only) - if: matrix.os == 'macos-latest' - run: pip install xattr - - - name: Install rust target - run: rustup target add ${{ matrix.target }} - - - run: yarn && yarn build && yarn tauri build --target ${{ matrix.target }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/upload-artifact@v3 - if: matrix.os == 'macos-latest' - with: - name: artifacts-${{ matrix.arch }} - path: | - ./target/${{ matrix.target }}/release/bundle/dmg/**.dmg - ./target/${{ matrix.target }}/release/bundle/macos/**.app.* + platform: [macos-latest, windows-latest] - - uses: actions/upload-artifact@v3 - if: matrix.os == 'windows-latest' - with: - name: artifacts-${{ matrix.arch }} - path: | - ./target/${{ matrix.target }}/release/bundle/msi/** - - release-chatgptstacks: - needs: build-chatgptstacks - runs-on: macos-latest + runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v3 - - - name: Install xattr - run: | - sudo apt-get update - sudo apt-get install -y xattr - - - name: Query version number - run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV - - - name: Download x86_64 artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts/x86_64 - - - name: Download aarch64 artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts/aarch64 - - - name: Rename artifacts - run: | - mv "artifacts/aarch64/dmg/chatgptstacks_${{ env.version }}_aarch64.dmg" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.dmg" - mv "artifacts/aarch64/macos/chatgptstacks.app.tar.gz" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.app.tar.gz" - mv "artifacts/aarch64/macos/chatgptstacks.app.tar.gz.sig" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.app.tar.gz.sig" - - mv "artifacts/x86_64/dmg/chatgptstacks_${{ env.version }}_x64.dmg" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.dmg" - mv "artifacts/x86_64/macos/chatgptstacks.app.tar.gz" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.app.tar.gz" - mv "artifacts/x86_64/macos/chatgptstacks.app.tar.gz.sig" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.app.tar.gz.sig" - - mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi" - mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi.zip" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi.zip" - mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi.zip.sig" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi.zip.sig" - - - name: Create Release - uses: softprops/action-gh-release@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ env.version }} - name: chatgptstacks v${{ env.version }} - body: See the assets to download this version and install. - prerelease: false - generate_release_notes: false - files: ./artifacts/**/* \ No newline at end of file + - uses: actions/checkout@v2 + - name: setup node + uses: actions/setup-node@v1 + with: + node-version: 16 + - name: install Rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + - name: install app dependencies and build it + run: yarn && yarn build && yarn tauri build + - uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tagName: chatgptstacks-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + releaseName: "__VERSION__" + releaseBody: "See the assets to download this version and install." + releaseDraft: true + prerelease: false \ No newline at end of file