Skip to content

use node-fetch + ignore items without nutrition info #58

use node-fetch + ignore items without nutrition info

use node-fetch + ignore items without nutrition info #58

name: Deploy Tauri binaries on merge
on:
push:
paths:
- "client/**"
- "shared/**"
- "firebase.json" # Assume most `firebase.json` changes are hosting rewrites edits
branches:
- '**'
tags-ignore:
- 'client-**' # Ignore tags created by this workflow to prevent unnecessary rerunning
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all commits in the repository for commit-count sorting
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: npm install
- name: Set outputs
shell: bash
id: vars
run: |
echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "commit_count=$(git log --oneline | wc -l | xargs)" >> $GITHUB_OUTPUT
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: 'client'
tagName: 'client-${{ steps.vars.outputs.commit_count }}-${{ github.ref_name }}-${{ steps.vars.outputs.sha_short }}'
releaseName: 'WATT client @ ${{ steps.vars.outputs.sha_short }} (${{ github.ref_name }})'
releaseBody: "Use the corresponding installer bundled in assets to download the WATT desktop client.\n### Changes since last release:\n```\n- ${{ join(github.event.commits.*.message, '\n- ') }}\n```"
releaseDraft: false
prerelease: ${{ github.ref_name != 'main' }} # Prerelease if workflow triggered on a branch commit