2022-12-07 05:45:15 -05:00
|
|
|
name: Release CI
|
|
|
|
|
2023-02-06 01:37:49 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
2022-12-07 05:45:15 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-release:
|
2023-02-06 01:22:58 -05:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-06 01:16:51 -05:00
|
|
|
# outputs:
|
|
|
|
# RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
2022-12-07 05:45:15 -05:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Query version number
|
|
|
|
id: get_version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "using version tag ${GITHUB_REF:10}"
|
2022-12-23 09:10:27 -05:00
|
|
|
echo "version=${GITHUB_REF:10}" >> $GITHUB_ENV
|
2022-12-07 05:45:15 -05:00
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-12-23 09:10:27 -05:00
|
|
|
tag_name: '${{ env.version }}'
|
|
|
|
release_name: 'ChatGPT ${{ env.version }}'
|
2022-12-07 05:45:15 -05:00
|
|
|
body: 'See the assets to download this version and install.'
|
|
|
|
|
|
|
|
build-tauri:
|
|
|
|
needs: create-release
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-02-06 01:16:51 -05:00
|
|
|
include:
|
|
|
|
- build: linux
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: stable
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- build: linux
|
|
|
|
os: ubuntu-latest
|
|
|
|
rust: stable
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
- build: macos
|
|
|
|
os: macos-latest
|
|
|
|
rust: stable
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- buid: macos
|
|
|
|
os: macos-latest
|
|
|
|
rust: stable
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
rust: stable
|
|
|
|
target: x86_64-pc-windows-msvc
|
2022-12-07 05:45:15 -05:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
2022-12-27 12:25:28 -05:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-06 01:16:51 -05:00
|
|
|
|
|
|
|
- name: Install Node.js
|
2022-12-27 12:25:28 -05:00
|
|
|
uses: actions/setup-node@v3
|
2022-12-07 05:45:15 -05:00
|
|
|
with:
|
2023-02-06 01:16:51 -05:00
|
|
|
node-version: 18
|
|
|
|
cache: pnpm
|
|
|
|
cache-dependency-path: chatgpt/pnpm-lock.yaml
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-02-06 01:16:51 -05:00
|
|
|
- name: 'Setup Rust'
|
2022-12-27 12:25:28 -05:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2023-02-06 01:16:51 -05:00
|
|
|
with:
|
|
|
|
targets: ${{ matrix.config.rust_target }}
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
key: ${{ matrix.config.rust_target }}
|
|
|
|
|
2022-12-07 05:45:15 -05:00
|
|
|
- name: install dependencies (ubuntu only)
|
2023-02-06 01:16:51 -05:00
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
2022-12-07 05:45:15 -05:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-02-06 01:16:51 -05:00
|
|
|
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: cd chatgpt && pnpm install --force
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-02-06 01:16:51 -05:00
|
|
|
- name: Build
|
|
|
|
run: pnpm build:fe
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-01-05 00:18:35 -05:00
|
|
|
# - name: Rewrite tauri.conf.json
|
2023-02-06 01:16:51 -05:00
|
|
|
# run: pnpm fix:conf
|
|
|
|
|
|
|
|
- name: Install rust target
|
|
|
|
run: rustup target add ${{ matrix.target }}
|
2023-01-04 08:44:23 -05:00
|
|
|
|
2022-12-27 12:12:03 -05:00
|
|
|
- name: fix tray icon
|
|
|
|
if: matrix.platform != 'macos-latest'
|
|
|
|
run: |
|
2023-02-06 01:16:51 -05:00
|
|
|
pnpm fix:tray
|
2022-12-27 12:12:03 -05:00
|
|
|
|
2022-12-07 05:45:15 -05:00
|
|
|
- uses: tauri-apps/tauri-action@v0.3
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# 📝: https://tauri.app/v1/guides/distribution/updater#signing-updates
|
|
|
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
|
|
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
|
|
|
with:
|
2023-02-06 01:16:51 -05:00
|
|
|
args: --target ${{ matrix.target }}
|
|
|
|
# releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-02-06 01:16:51 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: matrix.target == 'aarch64-apple-darwin'
|
|
|
|
with:
|
|
|
|
name: chatgpt-macos-aarch64
|
|
|
|
path: ./target/aarch64-apple-darwin/release/bundle/macos/ChatGPT.app.tar.*
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-02-06 01:16:51 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: matrix.target == 'x86_64-apple-darwin'
|
|
|
|
with:
|
|
|
|
name: chatgpt-macos
|
|
|
|
path: ./target/x86_64-apple-darwin/release/bundle/macos/ChatGPT.app.tar.*
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: matrix.platform == 'windows-latest'
|
|
|
|
with:
|
|
|
|
name: chatgpt-windows
|
|
|
|
path: ./target/x86_64-pc-windows-msvc/release/bundle/msi/ChatGPT_**.msi.zip.*
|
2022-12-07 05:45:15 -05:00
|
|
|
|
2023-02-06 01:16:51 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
2023-01-07 02:25:08 -05:00
|
|
|
with:
|
2023-02-06 01:16:51 -05:00
|
|
|
name: chatgpt-linux
|
|
|
|
path: |
|
|
|
|
./target/x86_64-unknown-linux-gnu/release/bundle/appimage/chat-gpt_**.deb
|
|
|
|
./target/x86_64-unknown-linux-gnu/release/bundle/appimage/chat-gpt_**.AppImage.tar.*
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
|
|
with:
|
|
|
|
name: chatgpt-linux
|
|
|
|
path: |
|
|
|
|
./target/aarch64-unknown-linux-gnu/release/bundle/appimage/chat-gpt_**.deb
|
|
|
|
./target/aarch64-unknown-linux-gnu/release/bundle/appimage/chat-gpt_**.AppImage.tar.*
|
|
|
|
|
|
|
|
# updater:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# needs: [create-release, build-tauri]
|
|
|
|
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v3
|
|
|
|
|
|
|
|
# - name: Install Node.js
|
|
|
|
# uses: actions/setup-node@v3
|
|
|
|
# with:
|
|
|
|
# node-version: 18
|
|
|
|
# cache: pnpm
|
|
|
|
# cache-dependency-path: chatgpt/pnpm-lock.yaml
|
|
|
|
|
|
|
|
# - name: Install dependencies
|
|
|
|
# run: cd chatgpt && pnpm install --force
|
|
|
|
|
|
|
|
# - run: pnpm updater --token=${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
# - name: Deploy install.json
|
|
|
|
# uses: peaceiris/actions-gh-pages@v3
|
|
|
|
# with:
|
|
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# # 📝: Edit the deployment directory
|
|
|
|
# publish_dir: ./updater
|
|
|
|
# # force_orphan: true
|
2023-01-07 01:38:16 -05:00
|
|
|
|
2023-01-25 06:19:13 -05:00
|
|
|
# publish-winget:
|
|
|
|
# # Action can only be run on windows
|
|
|
|
# runs-on: windows-latest
|
|
|
|
# needs: [create-release, build-tauri]
|
|
|
|
# steps:
|
|
|
|
# - uses: vedantmgoyal2009/winget-releaser@v1
|
|
|
|
# with:
|
|
|
|
# identifier: lencx.ChatGPT
|
|
|
|
# token: ${{ secrets.WINGET_TOKEN }}
|
|
|
|
# version: ${{ env.version }}
|