Skip to content

Release CI

Release CI #73

Workflow file for this run

name: Release CI
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
create-release:
runs-on: ubuntu-latest
# outputs:
# RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v2
- name: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:10}"
echo "version=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: '${{ env.version }}'
release_name: 'ChatGPT ${{ env.version }}'
body: 'See the assets to download this version and install.'
build-tauri:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
needs: create-release
strategy:
fail-fast: false
matrix:
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
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: 'Setup Rust'
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_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 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Install dependencies
run: cd chatgpt && pnpm install --force
- name: Build
run: pnpm build:fe
# - name: Rewrite tauri.conf.json
# run: pnpm fix:conf
- name: Install rust target
run: rustup target add ${{ matrix.target }}
- name: fix tray icon
if: matrix.platform != 'macos-latest'
run: |
pnpm fix:tray
- uses: tauri-apps/[email protected]
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:
args: --target ${{ matrix.target }}
# releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
- 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.*
- 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.*
- uses: actions/upload-artifact@v3
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
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
# 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 }}