Skip to content

Commit

Permalink
feat: update ci to use docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanzyTHEbar committed May 10, 2023
1 parent 8f55f4d commit 1d9fd84
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 26 deletions.
86 changes: 61 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- tauri
- feature/tauri
#- master
#- main

Expand Down Expand Up @@ -33,31 +34,52 @@ jobs:
node-version: [18.x]
#, macos-latest
#windows-latest,
platform: [ubuntu-18.04]
include:
- os: ubuntu-18.04
rust_target: x86_64-unknown-linux-gnu
#- os: windows-latest
# rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
# rust_target: aarch64-apple-darwin
platform: [ubuntu-latest]
#include:
#- os: ubuntu-18.04
# rust_target: x86_64-unknown-linux-gnu
#- os: windows-latest
# rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
# rust_target: aarch64-apple-darwin
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ env.GITHUB_TOKEN }}
- name: Run Docker container
if: matrix.platform == 'ubuntu-latest'
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/zanzythebar/tauridocker:latest
options: -v ${{ github.workspace }}:/workspace
run: |
export NODE_VERSION=16.13.0
mkdir build
echo "::group::install node dependencies"
npm install -g pnpm
npm install -g typescript
pnpm install
echo "::group::tauri build"
pnpm tauri build
echo "::endgroup::"
- name: Verify build
run: |
ls -la build
- name: Node.js setup ${{ matrix.node-version }}
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
#cache: "pnpm"
# node-version-file: '.nvmrc'

- name: "Setup Rust"
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
default: true
Expand All @@ -68,20 +90,22 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"

#- 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 dependencies (PNPM)
# run: |
# npm install -g pnpm
# npm install -g typescript
# pnpm install

- 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 dependencies (PNPM)
run: |
npm install -g pnpm
npm install -g typescript
pnpm install
- uses: JonasKruckenberg/tauri-build@v1.2.3
- name: Build the app
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: JonasKruckenberg/tauri-build@v1.2.3
id: tauri_build
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
Expand All @@ -94,11 +118,23 @@ jobs:
with:
target: ${{ matrix.platform.rust_target }}

- uses: actions/upload-artifact@v3
- name: Archive Tauri Artifacts
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: production-files
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"

- name: Archive Software Binaries
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-software
#path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin"
path: "target/build/"
retention-days: 5
if-no-files-found: error

#- name: Build the app
# uses: tauri-apps/tauri-action@v0
# env:
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1d9fd84

Please sign in to comment.