Skip to content

build: using pnpm@9 and node@lts for GitHub actions #20

build: using pnpm@9 and node@lts for GitHub actions

build: using pnpm@9 and node@lts for GitHub actions #20

Workflow file for this run

name: Release project
# Copied from https://github.com/lencx/ChatGPT/blob/fac5a4399ed553424be5388fe5eb24d5e5c0e98c/.github/workflows/release.yml
# Thanks, changed a little.
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build-tauri-redis:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: linux
os: ubuntu-latest
arch: x86_64
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
arch: x86_64
target: x86_64-apple-darwin
- build: macos
os: macos-latest
arch: aarch64
target: aarch64-apple-darwin
- build: windows
os: windows-latest
arch: x86_64
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/Iron
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Build FE
run: pnpm build
- name: Install rust target
run: rustup target add ${{ matrix.target }}
# Temporarily no need. No custom icon yet.
# - name: fix tray icon
# if: matrix.os != 'macos-latest'
# run: |
# pnpm fix:tray
- run: pnpm tauri:build --target ${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: artifacts-${{ matrix.arch }}
path: |
./src-tauri/target/${{ matrix.target }}/release/bundle/appimage/**.AppImage.*
./src-tauri/target/${{ matrix.target }}/release/bundle/deb/**.deb
- uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: artifacts-${{ matrix.arch }}
path: |
./src-tauri/target/${{ matrix.target }}/release/bundle/dmg/**.dmg
./src-tauri/target/${{ matrix.target }}/release/bundle/macos/**.app.*
- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: artifacts-${{ matrix.arch }}
path: |
./src-tauri/target/${{ matrix.target }}/release/bundle/msi/**
./src-tauri/target/${{ matrix.target }}/release/bundle/nsis/**
release-tauri-redis:
needs: build-tauri-redis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Query version number
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Download x86_64 artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-x86_64
path: artifacts/x86_64
- name: Download aarch64 artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-aarch64
path: artifacts/aarch64
- name: Rename artifacts
run: |
mv "artifacts/aarch64/dmg/tauri-redis_${{ env.version }}_aarch64.dmg" "artifacts/tauri_redis_${{ env.version }}_macos_aarch64.dmg"
mv "artifacts/x86_64/dmg/tauri-redis_${{ env.version }}_x64.dmg" "artifacts/tauri_redis_${{ env.version }}_macos_x86_64.dmg"
mv "artifacts/x86_64/deb/tauri-redis_${{ env.version }}_amd64.deb" "artifacts/tauri_redis_${{ env.version }}_linux_x86_64.deb"
mv "artifacts/x86_64/msi/tauri-redis_${{ env.version }}_x64_en-US.msi" "artifacts/tauri_redis_${{ env.version }}_windows_x86_64.msi"
mv "artifacts/x86_64/nsis/tauri-redis_${{ env.version }}_x64-setup.exe" "artifacts/tauri_redis_${{ env.version }}_windows_x86_64.exe"
- name: Create Release
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }}
name: Tauri Redis v${{ env.version }}
body: See the assets to download this version and install.
prerelease: false
generate_release_notes: false
files: ./artifacts/**/*
# Temporarily no need.
# updater:
# runs-on: ubuntu-latest
# needs: release-tauri-redis
#
# steps:
# - uses: actions/checkout@v3
#
# - uses: pnpm/action-setup@v2
# name: Install pnpm
# id: pnpm-install
# with:
# version: 7
# run_install: false
#
# - name: Install Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: pnpm
# - run: pnpm install --frozen-lockfile
#
# - name: Updater JSON
# run: pnpm updater --token=${{ secrets.GITHUB_TOKEN }}
#
# - name: Deploy install.json
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./updater
# # force_orphan: true
#
# - name: Query version number
# run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV