Skip to content

Commit

Permalink
build: Add Github Actions and issue template
Browse files Browse the repository at this point in the history
build: Add docker-compose.yml
refactor: Hide access password field when no password protection is enabled
fix: Fixed the issue that the audio duration cannot be obtained normally in Safari browser
fix: Fix the ENABLE_PROTECT logic error
  • Loading branch information
Amery2010 committed Jun 12, 2024
1 parent 35f04d4 commit a63e81d
Show file tree
Hide file tree
Showing 20 changed files with 920 additions and 54 deletions.
146 changes: 146 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Bug report
description: Create a report to help us improve
title: '[Bug] '
labels: ['bug']

body:
- type: markdown
attributes:
value: '## Describe the bug'
- type: textarea
id: bug-description
attributes:
label: 'Bug Description'
description: 'A clear and concise description of what the bug is.'
placeholder: 'Explain the bug...'
validations:
required: true

- type: markdown
attributes:
value: '## To Reproduce'
- type: textarea
id: steps-to-reproduce
attributes:
label: 'Steps to Reproduce'
description: 'Steps to reproduce the behavior:'
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true

- type: markdown
attributes:
value: '## Expected behavior'
- type: textarea
id: expected-behavior
attributes:
label: 'Expected Behavior'
description: 'A clear and concise description of what you expected to happen.'
placeholder: 'Describe what you expected to happen...'
validations:
required: true

- type: markdown
attributes:
value: '## Screenshots'
- type: textarea
id: screenshots
attributes:
label: 'Screenshots'
description: 'If applicable, add screenshots to help explain your problem.'
placeholder: "Paste your screenshots here or write 'N/A' if not applicable..."
validations:
required: false

- type: markdown
attributes:
value: '## Deployment'
- type: checkboxes
id: deployment
attributes:
label: 'Deployment Method'
description: 'Please select the deployment method you are using.'
options:
- label: 'Docker'
- label: 'Vercel'
- label: 'Server'

- type: markdown
attributes:
value: '## Desktop (please complete the following information):'
- type: input
id: desktop-os
attributes:
label: 'Desktop OS'
description: 'Your desktop operating system.'
placeholder: 'e.g., Windows 10'
validations:
required: false
- type: input
id: desktop-browser
attributes:
label: 'Desktop Browser'
description: 'Your desktop browser.'
placeholder: 'e.g., Chrome, Safari'
validations:
required: false
- type: input
id: desktop-version
attributes:
label: 'Desktop Browser Version'
description: 'Version of your desktop browser.'
placeholder: 'e.g., 89.0'
validations:
required: false

- type: markdown
attributes:
value: '## Smartphone (please complete the following information):'
- type: input
id: smartphone-device
attributes:
label: 'Smartphone Device'
description: 'Your smartphone device.'
placeholder: 'e.g., iPhone X'
validations:
required: false
- type: input
id: smartphone-os
attributes:
label: 'Smartphone OS'
description: 'Your smartphone operating system.'
placeholder: 'e.g., iOS 14.4'
validations:
required: false
- type: input
id: smartphone-browser
attributes:
label: 'Smartphone Browser'
description: 'Your smartphone browser.'
placeholder: 'e.g., Safari'
validations:
required: false
- type: input
id: smartphone-version
attributes:
label: 'Smartphone Browser Version'
description: 'Version of your smartphone browser.'
placeholder: 'e.g., 14'
validations:
required: false

- type: markdown
attributes:
value: '## Additional Logs'
- type: textarea
id: additional-logs
attributes:
label: 'Additional Logs'
description: 'Add any logs about the problem here.'
placeholder: 'Paste any relevant logs here...'
validations:
required: false
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Feature request
description: Suggest an idea for this project
title: '[Feature Request]: '
labels: ['feature']

body:
- type: markdown
attributes:
value: '## Is your feature request related to a problem? Please describe.'
- type: textarea
id: problem-description
attributes:
label: Problem Description
description: "A clear and concise description of what the problem is. Example: I'm always frustrated when [...]"
placeholder: 'Explain the problem you are facing...'
validations:
required: true

- type: markdown
attributes:
value: "## Describe the solution you'd like"
- type: textarea
id: desired-solution
attributes:
label: Solution Description
description: A clear and concise description of what you want to happen.
placeholder: "Describe the solution you'd like..."
validations:
required: true

- type: markdown
attributes:
value: "## Describe alternatives you've considered"
- type: textarea
id: alternatives-considered
attributes:
label: Alternatives Considered
description: A clear and concise description of any alternative solutions or features you've considered.
placeholder: "Describe any alternative solutions or features you've considered..."
validations:
required: false

- type: markdown
attributes:
value: '## Additional context'
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context or screenshots about the feature request here.
placeholder: 'Add any other context or screenshots about the feature request here...'
validations:
required: false
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'weekly'
46 changes: 46 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Docker image

on:
push:
tags:
# Push events matching v*, such as v1.0, v20.15.10, etc. to trigger workflows
- 'v*'

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: xiangfa/talk-with-gemini
tags: |
type=raw,value=latest
type=ref,event=tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
15 changes: 15 additions & 0 deletions .github/workflows/issue-translator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Issue Translator
on:
issue_comment:
types: [created]
issues:
types: [opened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/[email protected]
with:
IS_MODIFY_TITLE: false
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.
42 changes: 25 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'publish'
name: Release

on:
push:
Expand All @@ -16,28 +16,28 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''
config:
- os: ubuntu-latest
arch: x86_64
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
arch: aarch64
rust_target: x86_64-apple-darwin,aarch64-apple-darwin
- os: windows-latest
arch: x86_64
rust_target: x86_64-pc-windows-msvc

runs-on: ${{ matrix.platform }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v4

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
targets: ${{ matrix.config.rust_target }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
if: matrix.config.os == 'ubuntu-latest' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
Expand All @@ -61,10 +61,18 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'App v__VERSION__'
tagName: talk-with-gemini-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'TalkWithGemini v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }}
40 changes: 40 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upstream Sync

permissions:
contents: write

on:
schedule:
- cron: '0 4 * * *' # At 04:00, every day
workflow_dispatch:

jobs:
sync_latest_from_upstream:
name: Sync latest commits from upstream repo
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork }}

steps:
# Step 1: run a standard checkout action
- name: Checkout target repo
uses: actions/checkout@v3

# Step 2: run the sync action
- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
upstream_sync_repo: Amery2010/TalkWithGemini
upstream_sync_branch: main
target_sync_branch: main
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set

# Set test_mode true to run tests instead of the true action!!
test_mode: false

- name: Sync check
if: failure()
run: |
echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次。"
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork."
exit 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# production
/build
/release
/public/sw.js

# misc
.DS_Store
Expand Down
Loading

0 comments on commit a63e81d

Please sign in to comment.