Skip to content

rename MY_GITHUB_TOKEN in workflow #1

rename MY_GITHUB_TOKEN in workflow

rename MY_GITHUB_TOKEN in workflow #1

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
output_path: build/linux/x64/release/bundle
asset_name: chatmcp-linux-x64.tar.gz
build_target: linux
- os: macos-latest
output_path: build/macos/Build/Products/Release/chatmcp.app
asset_name: chatmcp-macos-x64.dmg
build_target: macos
- os: windows-latest
output_path: build/windows/x64/Runner/Release/chatmcp.exe
asset_name: chatmcp-windows-x64.exe
build_target: windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.27.0'
- name: Create empty .env file
run: touch .env
- name: Install Linux Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Install dependencies
run: flutter pub get
- name: Build ${{ matrix.build_target }}
run: flutter build ${{ matrix.build_target }} --release
- name: Package Linux App
if: matrix.os == 'ubuntu-latest'
run: |
cd build/linux/x64/release/bundle
tar -czf "${GITHUB_WORKSPACE}/${{ matrix.asset_name }}" *
- name: Package macOS App
if: matrix.os == 'macos-latest'
run: |
brew install create-dmg
create-dmg \
--volname "ChatMcp" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "chatmcp.app" 200 190 \
--hide-extension "chatmcp.app" \
--app-drop-link 600 185 \
"${{ matrix.asset_name }}" \
"${{ matrix.output_path }}"
- name: Copy Windows Executable
if: matrix.os == 'windows-latest'
run: |
Copy-Item -Path "build/windows/x64/Runner/Release/chatmcp.exe" -Destination "${{ matrix.asset_name }}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: chatmcp-${{ matrix.build_target }}
path: ${{ matrix.asset_name }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}