From bfb6a475019f98ccbd8bfdc7ef2e379cd9b9c4b4 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Thu, 5 Jan 2023 17:15:13 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=99=8D=E7=BA=A7ubunt?= =?UTF-8?q?u=E7=89=88=E6=9C=AC=E5=88=B020.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tlntin --- .github/workflows/pake_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index aac097d..6279071 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -15,7 +15,7 @@ jobs: build: [linux, windows, macos] include: - build: linux - os: ubuntu-latest + os: ubuntu-20.04 rust: nightly target: x86_64-unknown-linux-musl - build: windows From 039858047619db594992ca86eb363785fb632c41 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Thu, 5 Jan 2023 17:26:14 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E9=99=8D=E7=BA=A7ubunt?= =?UTF-8?q?u=E7=89=88=E6=9C=AC=E5=88=B020.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 6279071..4f046ce 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -46,7 +46,7 @@ jobs: target: ${{ matrix.target }} - name: install dependencies (ubuntu only) - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-20.04' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf gnome-video-effects gnome-video-effects-extra From cc4f7b3dc740eadfc1c5e07f2e47b5c33a1f1883 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Thu, 5 Jan 2023 17:29:43 +0800 Subject: [PATCH 03/14] Update pake_build.yaml Signed-off-by: Tlntin --- .github/workflows/pake_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 4f046ce..9629479 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -52,7 +52,7 @@ jobs: sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf gnome-video-effects gnome-video-effects-extra - name: build for Ubuntu - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-20.04' run: npm run build:all-unix - name: build for MacOS From cc550a4295f65b801b193b0e02cdd5855668de2e Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 11:00:29 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0target=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 5dff046..208350b 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -17,14 +17,17 @@ jobs: os: ubuntu-20.04 rust: nightly target: x86_64-unknown-linux-musl + archive-name: target-linux.tar.gz - build: windows os: windows-latest rust: nightly-x86_64-msvc target: x86_64-pc-windows-msvc + archive-name: target-windows.tar.gz - build: macos os: macos-latest rust: nightly target: x86_64-apple-darwin + archive-name: target-macos.tar.gz fail-fast: false steps: @@ -71,3 +74,15 @@ jobs: run: | curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh output/*/*.* + + - name: Build archive + shell: bash + run: | + cd src-tauri + tar -czf "${{ matrix.archive-name }}" target + + - name: Upload archive + uses: actions/upload-artifact@v1 + with: + name: ${{ matrix.archive-name }} + path: archive/${{ matrix.archive-name }} From 04f8e935bb1980be9c84c7cf2fe8abf555f932be Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 11:31:13 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0target=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 208350b..7ea81c5 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -85,4 +85,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: ${{ matrix.archive-name }} - path: archive/${{ matrix.archive-name }} + path: src-tauri/${{ matrix.archive-name }} From c92ede2c0d2d55c95310a4f44c189128c767e277 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 12:55:15 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=89=93=E5=8C=85linux?= =?UTF-8?q?/macos=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/build.sh b/script/build.sh index cabd0cf..7329a9c 100755 --- a/script/build.sh +++ b/script/build.sh @@ -103,12 +103,20 @@ do npm run tauri build mv src-tauri/target/release/bundle/deb/${package_prefix}-${package_name}*.deb output/linux/${package_title}_amd64.deb mv src-tauri/target/release/bundle/appimage/${package_prefix}-${package_name}*.AppImage output/linux/${package_title}_amd64.AppImage + echo clear cache + rm src-tauri/target/release + rm -rf src-tauri/target/release/bundle + fi if [[ "$OSTYPE" =~ ^darwin ]]; then npm run tauri build -- --target universal-apple-darwin mv src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg output/macos/${package_title}.dmg + echo clear cache + rm -rf src-tauri/target/universal-apple-darwin + rm src-tauri/target/aarch64-apple-darwin/release + rm src-tauri/target/x86_64-apple-darwin/release fi echo "package build success!" From e3a562e3efee9171da8868e4aebc43a788545f7e Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 13:05:21 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0linux/macos=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 7ea81c5..297fcaa 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -52,6 +52,8 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf gnome-video-effects gnome-video-effects-extra + git clone https://github.com/Tlntin/pake_target_linux.git + mv pake_target_linux/target src-tauri/target - name: build for Ubuntu if: matrix.os == 'ubuntu-20.04' @@ -61,6 +63,8 @@ jobs: if: matrix.os == 'macos-latest' run: | rustup target add aarch64-apple-darwin + git clone https://github.com/Tlntin/pake_target_macos.git + mv pake_target_macos/target src-tauri/target npm run build:all-unix - name: build for windows @@ -75,14 +79,14 @@ jobs: curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh output/*/*.* - - name: Build archive - shell: bash - run: | - cd src-tauri - tar -czf "${{ matrix.archive-name }}" target + # - name: Build archive + # shell: bash + # run: | + # cd src-tauri + # tar -czf "${{ matrix.archive-name }}" target - - name: Upload archive - uses: actions/upload-artifact@v1 - with: - name: ${{ matrix.archive-name }} - path: src-tauri/${{ matrix.archive-name }} + # - name: Upload archive + # uses: actions/upload-artifact@v1 + # with: + # name: ${{ matrix.archive-name }} + # path: src-tauri/${{ matrix.archive-name }} From e564af07318463ee08c4d59a830d0198603fcf42 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 14:40:09 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9rust=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BAstable,=E5=B0=9D=E8=AF=95=E5=A2=9E=E5=8A=A0=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 65 ++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 297fcaa..030a8b9 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -15,19 +15,19 @@ jobs: include: - build: linux os: ubuntu-20.04 - rust: nightly + rust: stable target: x86_64-unknown-linux-musl - archive-name: target-linux.tar.gz + # archive-name: target-linux.tar.gz - build: windows os: windows-latest - rust: nightly-x86_64-msvc + rust: stable-x86_64-msvc target: x86_64-pc-windows-msvc - archive-name: target-windows.tar.gz + # archive-name: target-windows.tar.gz - build: macos os: macos-latest - rust: nightly + rust: stable target: x86_64-apple-darwin - archive-name: target-macos.tar.gz + # archive-name: target-macos.tar.gz fail-fast: false steps: @@ -52,8 +52,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf gnome-video-effects gnome-video-effects-extra - git clone https://github.com/Tlntin/pake_target_linux.git - mv pake_target_linux/target src-tauri/target - name: build for Ubuntu if: matrix.os == 'ubuntu-20.04' @@ -63,8 +61,6 @@ jobs: if: matrix.os == 'macos-latest' run: | rustup target add aarch64-apple-darwin - git clone https://github.com/Tlntin/pake_target_macos.git - mv pake_target_macos/target src-tauri/target npm run build:all-unix - name: build for windows @@ -90,3 +86,52 @@ jobs: # with: # name: ${{ matrix.archive-name }} # path: src-tauri/${{ matrix.archive-name }} + + - name: "Store cache" + uses: Swatinem/rust-cache@v2 + with: + # The prefix cache key, this can be changed to start a new cache manually. + # default: "v0-rust" + prefix-key: "" + + # A cache key that is used instead of the automatic `job`-based key, + # and is stable over multiple jobs. + # default: empty + shared-key: "" + + # An additional cache key that is added alongside the automatic `job`-based + # cache key and can be used to further differentiate jobs. + # default: empty + key: "" + + # A whitespace separated list of env-var *prefixes* who's value contributes + # to the environment cache key. + # The env-vars are matched by *prefix*, so the default `RUST` var will + # match all of `RUSTC`, `RUSTUP_*`, `RUSTFLAGS`, `RUSTDOC_*`, etc. + # default: "CARGO CC CFLAGS CXX CMAKE RUST" + env-vars: "" + + # The cargo workspaces and target directory configuration. + # These entries are separated by newlines and have the form + # `$workspace -> $target`. The `$target` part is treated as a directory + # relative to the `$workspace` and defaults to "target" if not explicitly given. + # default: ". -> target" + workspaces: "src-tauri" + + # Additional non workspace directories to be cached, separated by newlines. + cache-directories: "" + + # Determines whether workspace `target` directories are cached. + # If `false`, only the cargo registry will be cached. + # default: "true" + cache-targets: "" + + # Determines if the cache should be saved even when the workflow has failed. + # default: "false" + cache-on-failure: "" + + # Determiners whether the cache should be saved. + # If `false`, the cache is only restored. + # Useful for jobs where the matrix is additive e.g. additional Cargo features. + # default: "true" + save-if: "" From dcbb60703d41b877127fdb76d2f2362fd81188c0 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 15:26:12 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 75 +++++++++++-------------------- 1 file changed, 27 insertions(+), 48 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 030a8b9..6f6105a 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -46,6 +46,20 @@ jobs: profile: minimal override: true target: ${{ matrix.target }} + + - name: "Cache Restore" + uses: Swatinem/rust-cache@v2 + with: + prefix-key: "" + shared-key: "" + key: "" + env-vars: "" + workspaces: "src-tauri" + cache-directories: "" + cache-targets: "" + cache-on-failure: "" + save-if: "false" + # for more to see: https://github.com/Swatinem/rust-cache - name: install dependencies (ubuntu only) if: matrix.os == 'ubuntu-20.04' @@ -87,51 +101,16 @@ jobs: # name: ${{ matrix.archive-name }} # path: src-tauri/${{ matrix.archive-name }} - - name: "Store cache" - uses: Swatinem/rust-cache@v2 - with: - # The prefix cache key, this can be changed to start a new cache manually. - # default: "v0-rust" - prefix-key: "" - - # A cache key that is used instead of the automatic `job`-based key, - # and is stable over multiple jobs. - # default: empty - shared-key: "" - - # An additional cache key that is added alongside the automatic `job`-based - # cache key and can be used to further differentiate jobs. - # default: empty - key: "" - - # A whitespace separated list of env-var *prefixes* who's value contributes - # to the environment cache key. - # The env-vars are matched by *prefix*, so the default `RUST` var will - # match all of `RUSTC`, `RUSTUP_*`, `RUSTFLAGS`, `RUSTDOC_*`, etc. - # default: "CARGO CC CFLAGS CXX CMAKE RUST" - env-vars: "" - - # The cargo workspaces and target directory configuration. - # These entries are separated by newlines and have the form - # `$workspace -> $target`. The `$target` part is treated as a directory - # relative to the `$workspace` and defaults to "target" if not explicitly given. - # default: ". -> target" - workspaces: "src-tauri" - - # Additional non workspace directories to be cached, separated by newlines. - cache-directories: "" - - # Determines whether workspace `target` directories are cached. - # If `false`, only the cargo registry will be cached. - # default: "true" - cache-targets: "" - - # Determines if the cache should be saved even when the workflow has failed. - # default: "false" - cache-on-failure: "" - - # Determiners whether the cache should be saved. - # If `false`, the cache is only restored. - # Useful for jobs where the matrix is additive e.g. additional Cargo features. - # default: "true" - save-if: "" + # - name: "Store cache" + # uses: Swatinem/rust-cache@v2 + # with: + # prefix-key: "" + # shared-key: "" + # key: "" + # env-vars: "" + # workspaces: "src-tauri" + # cache-directories: "" + # cache-targets: "" + # cache-on-failure: "" + # save-if: "" + # for more to see: https://github.com/Swatinem/rust-cache From 289d0055e4ae1d01cc08ca7297b8778a1954170f Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 15:53:25 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ubuntu=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E4=BE=9D=E8=B5=96=E7=BC=93=E5=AD=98,=E6=B5=8B?= =?UTF-8?q?=E8=AF=95rust=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 6f6105a..be58521 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -63,9 +63,21 @@ jobs: - name: install dependencies (ubuntu only) if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf gnome-video-effects gnome-video-effects-extra + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra + version: 1.1 + + - name: rust cache test + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: build for Ubuntu if: matrix.os == 'ubuntu-20.04' From 4b12b84eacfc9acff004e5949ae1a74b3d77a83c Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 15:58:02 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95rust=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index be58521..bbc125a 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -101,6 +101,17 @@ jobs: curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh output/*/*.* + - name: rust cache store + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + # - name: Build archive # shell: bash # run: | From bdb87d1ba071a9acaf372fb98888e90adc44cd06 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 16:33:56 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95rust=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index bbc125a..d988116 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -68,8 +68,8 @@ jobs: packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra version: 1.1 - - name: rust cache test - uses: actions/cache@v3 + - name: rust cache restore + uses: ylemkimon/cache-restore@v2 with: path: | ~/.cargo/bin/ From 26bcd862c056f15c608b32a06bab071d81830264 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 17:11:19 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0release=20=E5=88=86?= =?UTF-8?q?=E6=94=AF=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 45 +------ .github/workflows/pake_build_with_cache.yaml | 125 +++++++++++++++++++ 2 files changed, 128 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/pake_build_with_cache.yaml diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index d988116..f9fbdf8 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -1,9 +1,9 @@ -name: Build App +name: Build App with Cache on: push: # Sequence of patterns matched against refs/tags - tags: - - "V*" + branches: + - release jobs: build: @@ -47,37 +47,12 @@ jobs: override: true target: ${{ matrix.target }} - - name: "Cache Restore" - uses: Swatinem/rust-cache@v2 - with: - prefix-key: "" - shared-key: "" - key: "" - env-vars: "" - workspaces: "src-tauri" - cache-directories: "" - cache-targets: "" - cache-on-failure: "" - save-if: "false" - # for more to see: https://github.com/Swatinem/rust-cache - - name: install dependencies (ubuntu only) if: matrix.os == 'ubuntu-20.04' uses: awalsh128/cache-apt-pkgs-action@latest with: packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra version: 1.1 - - - name: rust cache restore - uses: ylemkimon/cache-restore@v2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - src-tauri/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: build for Ubuntu if: matrix.os == 'ubuntu-20.04' @@ -123,17 +98,3 @@ jobs: # with: # name: ${{ matrix.archive-name }} # path: src-tauri/${{ matrix.archive-name }} - - # - name: "Store cache" - # uses: Swatinem/rust-cache@v2 - # with: - # prefix-key: "" - # shared-key: "" - # key: "" - # env-vars: "" - # workspaces: "src-tauri" - # cache-directories: "" - # cache-targets: "" - # cache-on-failure: "" - # save-if: "" - # for more to see: https://github.com/Swatinem/rust-cache diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml new file mode 100644 index 0000000..da68b26 --- /dev/null +++ b/.github/workflows/pake_build_with_cache.yaml @@ -0,0 +1,125 @@ +name: Build App +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - "V*" + +jobs: + build: + name: build + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [linux, windows, macos] + include: + - build: linux + os: ubuntu-20.04 + rust: stable + target: x86_64-unknown-linux-musl + # archive-name: target-linux.tar.gz + - build: windows + os: windows-latest + rust: stable-x86_64-msvc + target: x86_64-pc-windows-msvc + # archive-name: target-windows.tar.gz + - build: macos + os: macos-latest + rust: stable + target: x86_64-apple-darwin + # archive-name: target-macos.tar.gz + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: install node + uses: actions/setup-node@v1 + with: + node-version: 18 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + target: ${{ matrix.target }} + + - name: install dependencies (ubuntu only) + if: matrix.os == 'ubuntu-20.04' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra + version: 1.1 + + - name: rust cache restore + uses: ylemkimon/cache-restore@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: build for Ubuntu + if: matrix.os == 'ubuntu-20.04' + run: npm run build:all-unix + + - name: build for MacOS + if: matrix.os == 'macos-latest' + run: | + rustup target add aarch64-apple-darwin + npm run build:all-unix + + - name: build for windows + if: matrix.os == 'windows-latest' + run: | + npm run build:all-windows + + - name: Upload files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh + bash upload.sh output/*/*.* + + - name: rust cache store + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + # - name: Build archive + # shell: bash + # run: | + # cd src-tauri + # tar -czf "${{ matrix.archive-name }}" target + + # - name: Upload archive + # uses: actions/upload-artifact@v1 + # with: + # name: ${{ matrix.archive-name }} + # path: src-tauri/${{ matrix.archive-name }} + + # - name: "Store cache" + # uses: Swatinem/rust-cache@v2 + # with: + # prefix-key: "" + # shared-key: "" + # key: "" + # env-vars: "" + # workspaces: "src-tauri" + # cache-directories: "" + # cache-targets: "" + # cache-on-failure: "" + # save-if: "" + # for more to see: https://github.com/Swatinem/rust-cache From d9b35cfacf7a194d9e5028171485e1e1c2969a02 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 8 Jan 2023 17:45:15 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0release=20=E5=88=86?= =?UTF-8?q?=E6=94=AF=E7=BC=93=E5=AD=98=E6=81=A2=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 29 ++------------------ .github/workflows/pake_build_with_cache.yaml | 20 ++------------ 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index f9fbdf8..3c9653b 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -1,9 +1,9 @@ -name: Build App with Cache +name: Build App on: push: # Sequence of patterns matched against refs/tags - branches: - - release + tags: + - "V*" jobs: build: @@ -75,26 +75,3 @@ jobs: run: | curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh output/*/*.* - - - name: rust cache store - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - src-tauri/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - # - name: Build archive - # shell: bash - # run: | - # cd src-tauri - # tar -czf "${{ matrix.archive-name }}" target - - # - name: Upload archive - # uses: actions/upload-artifact@v1 - # with: - # name: ${{ matrix.archive-name }} - # path: src-tauri/${{ matrix.archive-name }} diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index da68b26..f0e1c77 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -1,9 +1,9 @@ -name: Build App +name: Build App with Cache on: push: # Sequence of patterns matched against refs/tags - tags: - - "V*" + branches: + - release jobs: build: @@ -109,17 +109,3 @@ jobs: # with: # name: ${{ matrix.archive-name }} # path: src-tauri/${{ matrix.archive-name }} - - # - name: "Store cache" - # uses: Swatinem/rust-cache@v2 - # with: - # prefix-key: "" - # shared-key: "" - # key: "" - # env-vars: "" - # workspaces: "src-tauri" - # cache-directories: "" - # cache-targets: "" - # cache-on-failure: "" - # save-if: "" - # for more to see: https://github.com/Swatinem/rust-cache