Skip to content

Commit

Permalink
Merge pull request #16 from geeker-ai/repubish
Browse files Browse the repository at this point in the history
build: add workflow
  • Loading branch information
zmhu committed Oct 6, 2023
2 parents 06b04dd + e9a7888 commit 86f3d5b
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 12 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: "Publish"
on:
push:
tags: [v\d+\.\d+\.\d+]
jobs:
fullter-build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# - target: aarch64-apple-darwin
# platform: macos-latest
- target: x86_64-apple-darwin
platform: macos-latest
# - target: x86_64-unknown-linux-gnu
# platform: ubuntu-20.04
- target: x86_64-pc-windows-msvc
platform: windows-latest

runs-on: ${{ matrix.platform }}
steps:
- name: Get version
id: get_version
uses: battila7/get-version-action@v2

- name: Install Java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.6"
channel: "stable"
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
# architecture: arm64 # optional, x64 or arm64

- name: Install flutter_distributor
run: dart pub global activate flutter_distributor

- name: setup node
if: matrix.platform == 'macos-latest'
uses: actions/setup-node@v3
with:
node-version: 16

# - name: setup python
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"

# - name: install pygithub
# run: |
# pip install pygithub

- name: install appdmg
if: matrix.platform == 'macos-latest'
run: |
yarn config set network-timeout 300000
yarn global add appdmg
# - name: Set up Homebrew
# if: matrix.platform == 'macos-latest'
# id: set-up-homebrew
# uses: Homebrew/actions/setup-homebrew@master

# - name: install 7zip
# if: matrix.platform == 'macos-latest'
# run: brew install p7zip

- name: Check Out
uses: actions/checkout@v3

- name: Change Version
env:
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
run: make change-version

- name: Build macos ios and android (site)
if: matrix.platform == 'macos-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
CHANNEL: "site"
SYSTEM_OS_NAME: "macos"
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_SIGN_KEY: ${{ secrets.ANDROID_SIGN_KEY }}
ANDROID_SIGN: true
ANDROID_KEY_PATH: key.jks
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo $ANDROID_SIGN_KEY | base64 -d > android/app/key.jks
make change-channel
flutter_distributor release --name macos-site --skip-clean
flutter_distributor release --name android-site --skip-clean
- name: Build macos ios and android (appstore)
if: matrix.platform == 'macos-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
CHANNEL: "appstore"
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_SIGN_KEY: ${{ secrets.ANDROID_SIGN_KEY }}
ANDROID_SIGN: true
ANDROID_KEY_PATH: key.jks
run: |
make change-channel
flutter_distributor release --name android-appstore --skip-clean
- name: Build windows
if: matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
CHANNEL: "site"
SYSTEM_OS_NAME: "windows"
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
shell: pwsh
run: |
echo "$env:LOCALAPPDATA\pub\cache\bin" >> $GITHUB_PATH
make change-channel
flutter_distributor release --name windows-site --skip-clean
27 changes: 15 additions & 12 deletions distribute_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# PGYER_API_KEY: "your api key"
output: dist/
releases:
- name: macos
- name: macos-site
jobs:
- name: macos-release-dmg
package:
Expand Down Expand Up @@ -30,7 +30,7 @@ releases:
# repo-owner: geeker-ai
# repo-name: geek_chat

- name: android
- name: android-site
jobs:
- name: android-apk
package:
Expand All @@ -46,31 +46,34 @@ releases:
repo-owner: geeker-ai
repo-name: geek_chat

- name: android-aab
- name: windows-site
jobs:
- name: windows-release-msix
package:
platform: android
target: aab
build_args:
dart-define:
APP_ENV: release
platform: windows
target: msix
publish:
target: github
args:
repo-owner: geeker-ai
repo-name: geek_chat

- name: windows
- name: android-appstore
jobs:
- name: windows-release-msix
- name: android-aab
package:
platform: windows
target: msix
platform: android
target: aab
build_args:
dart-define:
APP_ENV: release
publish:
target: github
args:
repo-owner: geeker-ai
repo-name: geek_chat


# - name: windows-release-exe
# package:
# platform: windows
Expand Down

0 comments on commit 86f3d5b

Please sign in to comment.