Attempt to add caching to our builds (#123)

This commit is contained in:
Tyler Wilding 2022-07-24 00:25:53 -04:00 committed by GitHub
parent 567003c9f1
commit 67e220dc7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 13 deletions

View file

@ -21,30 +21,37 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: setup node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
cache: npm
- name: install Rust stable - name: Install Rust Stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
- name: install dependencies (ubuntu only) - uses: Swatinem/rust-cache@v2
name: Cache Rust Build
with:
shared-key: tauri-build-${{ matrix.platform }}
workspaces: src-tauri
- name: Install Linux Dependencies
if: matrix.platform == 'ubuntu-latest' if: matrix.platform == 'ubuntu-latest'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev libglew2.1 patchelf sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev libglew2.1 patchelf
- name: install app dependencies and build it - name: Install NPM Dependencies and Mock Binaries
run: | run: |
npm ci npm ci
npm run mock-bin npm run mock-bin
npm run build npm run build
ls ./src-tauri/data/
- uses: tauri-apps/tauri-action@v0 - uses: tauri-apps/tauri-action@v0
name: Build Tauri App
timeout-minutes: 30 timeout-minutes: 30
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -23,28 +23,35 @@ jobs:
with: with:
token: ${{ secrets.BOT_PAT }} token: ${{ secrets.BOT_PAT }}
- name: setup node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
cache: npm
- name: install Rust stable - name: Install Rust Stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
- name: install dependencies (ubuntu only) - uses: Swatinem/rust-cache@v2
name: Cache Rust Build
with:
shared-key: tauri-build-${{ matrix.platform }}
workspaces: src-tauri
- name: Install Linux Dependencies
if: matrix.platform == 'ubuntu-latest' if: matrix.platform == 'ubuntu-latest'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev libglew2.1 patchelf sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev libglew2.1 patchelf
- name: install app dependencies - name: Install NPM Dependencies
run: | run: |
npm ci npm ci
npm run build npm run build
- name: download jak-project release - name: Download jak-project Release
env: env:
JAK_PROJ_VERSION: latest JAK_PROJ_VERSION: latest
PLATFORM: ${{ matrix.os }} PLATFORM: ${{ matrix.os }}
@ -55,11 +62,11 @@ jobs:
popd popd
node ./.github/scripts/download-binaries/index.js node ./.github/scripts/download-binaries/index.js
- name: prepare release config - name: Prepare Release Config
run: | run: |
npm run prepare-release-config npm run prepare-release-config
- name: prepare resources for build - name: Prepare Resources for Build
if: matrix.os == 'windows' if: matrix.os == 'windows'
run: | run: |
mv ./opengoal*.zip ./opengoal.zip mv ./opengoal*.zip ./opengoal.zip
@ -76,7 +83,7 @@ jobs:
ls ./src-tauri/bin ls ./src-tauri/bin
ls ./src-tauri/data ls ./src-tauri/data
- name: prepare resources for build - name: Prepare Resources for Build
if: matrix.os == 'linux' if: matrix.os == 'linux'
run: | run: |
mv ./opengoal*.tar.gz ./opengoal.tar.gz mv ./opengoal*.tar.gz ./opengoal.tar.gz
@ -94,6 +101,7 @@ jobs:
ls ./src-tauri/data ls ./src-tauri/data
- uses: tauri-apps/tauri-action@v0 - uses: tauri-apps/tauri-action@v0
name: Build Tauri App
timeout-minutes: 30 timeout-minutes: 30
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}