🐛 Restore rust cache
This commit is contained in:
150
.github/workflows/pake-cli.yaml
vendored
150
.github/workflows/pake-cli.yaml
vendored
@@ -8,9 +8,9 @@ on:
|
||||
default: "macos-latest"
|
||||
type: choice
|
||||
options:
|
||||
- "windows-latest"
|
||||
- "macos-latest"
|
||||
- "ubuntu-20.04"
|
||||
- "windows-latest"
|
||||
- "macos-latest"
|
||||
- "ubuntu-20.04"
|
||||
url:
|
||||
description: "[URL]"
|
||||
required: true
|
||||
@@ -44,9 +44,9 @@ on:
|
||||
default: "deb"
|
||||
type: choice
|
||||
options:
|
||||
- "deb"
|
||||
- "appimage"
|
||||
- "all"
|
||||
- "deb"
|
||||
- "appimage"
|
||||
- "all"
|
||||
|
||||
|
||||
jobs:
|
||||
@@ -57,71 +57,91 @@ jobs:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install Rust for ubuntu-20.04
|
||||
if: inputs.platform == 'ubuntu-20.04'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
- name: Install Rust for ubuntu-20.04
|
||||
if: inputs.platform == 'ubuntu-20.04'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
- name: Install Rust for windows-latest
|
||||
if: inputs.platform == 'windows-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable-x86_64-msvc
|
||||
target: x86_64-pc-windows-msvc
|
||||
- name: Install Rust for windows-latest
|
||||
if: inputs.platform == 'windows-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable-x86_64-msvc
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
- name: Install Rust for macos-latest
|
||||
if: inputs.platform == 'macos-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-apple-darwin
|
||||
- name: Install Rust for macos-latest
|
||||
if: inputs.platform == 'macos-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: inputs.platform == '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: install dependencies (ubuntu only)
|
||||
if: inputs.platform == '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: install pake-cli local
|
||||
shell: bash
|
||||
run: |
|
||||
echo "install pake on local"
|
||||
npm install pake-cli
|
||||
- name: install pake-cli local
|
||||
shell: bash
|
||||
run: |
|
||||
echo "install pake on local"
|
||||
npm install pake-cli
|
||||
|
||||
- name: rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
- name: rust cache restore
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache_store
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
node_modules/pake-cli/src-tauri/target/
|
||||
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
||||
|
||||
- name: build with pake-cli
|
||||
shell: pwsh
|
||||
run: |
|
||||
pwsh ./script/build_with_pake_cli.ps1
|
||||
env:
|
||||
URL: ${{ inputs.url }}
|
||||
NAME: ${{ inputs.name }}
|
||||
ICON: ${{ inputs.icon }}
|
||||
HEIGHT: ${{ inputs.height }}
|
||||
WIDTH: ${{ inputs.width }}
|
||||
TRANSPARENT: ${{ inputs.transparent }}
|
||||
FULLSCREEN: ${{ inputs.fullscreen }}
|
||||
RESIZE: ${{ inputs.resize }}
|
||||
MULTI_ARCH: ${{ inputs.multi_arch }}
|
||||
TARGETS: ${{ inputs.targets }}
|
||||
- name: build with pake-cli
|
||||
shell: pwsh
|
||||
run: |
|
||||
pwsh ./script/build_with_pake_cli.ps1
|
||||
env:
|
||||
URL: ${{ inputs.url }}
|
||||
NAME: ${{ inputs.name }}
|
||||
ICON: ${{ inputs.icon }}
|
||||
HEIGHT: ${{ inputs.height }}
|
||||
WIDTH: ${{ inputs.width }}
|
||||
TRANSPARENT: ${{ inputs.transparent }}
|
||||
FULLSCREEN: ${{ inputs.fullscreen }}
|
||||
RESIZE: ${{ inputs.resize }}
|
||||
MULTI_ARCH: ${{ inputs.multi_arch }}
|
||||
TARGETS: ${{ inputs.targets }}
|
||||
|
||||
- name: Upload archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: output-${{ inputs.platform }}.zip
|
||||
path: node_modules/pake-cli/output/*
|
||||
retention-days: 3
|
||||
|
||||
- name: Upload archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: output-${{ inputs.platform }}.zip
|
||||
path: node_modules/pake-cli/output/*
|
||||
retention-days: 3
|
||||
|
||||
- name: rust cache store
|
||||
uses: actions/cache/save@v3
|
||||
if: steps.cache_store.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
node_modules/pake-cli/src-tauri/target/
|
||||
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
||||
|
||||
Reference in New Issue
Block a user