Skip to content

fix: fix windows run bash shell #41

fix: fix windows run bash shell

fix: fix windows run bash shell #41

Workflow file for this run

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 Android dep
# if: matrix.platform == 'macos-latest'
# uses: actions/setup-java@v2
# with:
# distribution: "zulu"
# java-version: "11"
# - name: Install Flutter
# uses: subosito/flutter-action@v2
# with:
# 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: 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
if: matrix.platform == 'macos-latest'
run: |
if [ ! -d "releases" ]; then
mkdir releases
fi
touch releases/a.txt
echo "aaaa" > releases/a.txt
touch releases/b.txt
touch releases/c.txt
echo "aaaa" > releases/b.txt
echo "aaaa" > releases/c.txt
# flutter build macos --release
# cp -a "build/macos/Build/Products/Release/Geek Chat.app" releases/
# cd releases
# zip -r GeekChat-macos.zip "Geek Chat.app"
# rm -rf "Geek Chat.app"
# cd ..
# flutter build apk --release
# cp "build/app/outputs/flutter-apk/app-release.apk" releases/GeekChat.apk
- name: Build windows
if: matrix.platform == 'windows-latest'
shell: bash
run: |
if [ ! -d "releases" ]; then
mkdir releases
fi
echo "windows" > releases/windows.txt
- name: Publish Artefacts
# if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v3
env:
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
with:
name: GeekChat-${{ steps.get_version.outputs.version-without-v }}
path: releases/
- name: Build windows destop
if: matrix.platform == 'windows-latest'
run: |
echo ""
- name: Build Linux destop
if: matrix.platform == 'ubuntu-latest'
run: |
echo ""
flutter-release:
permissions:
contents: write
name: Release
needs: fullter-build
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Download Release Files
id: download
uses: actions/download-artifact@v3
with:
name: GeekChat-${{ steps.get_version.outputs.version-without-v }}
path: downloads/
env:
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
- name: Display structure of downloaded files
run: ls -R
# - name: Release
# uses: meeDamian/github-release@2.0
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag: Release-v${{ steps.get_version.outputs.version-without-v }}
# name: Release-v${{ steps.get_version.outputs.version-without-v }}
# body: Release ${{ steps.get_version.outputs.version-without-v }}
# draft: true
# gzip: false
# files: ${{steps.download.outputs.download-path}}/
# env:
# VERSION: ${{ steps.get_version.outputs.version-without-v }}
- name: Create Release # https://trstringer.com/github-actions-create-release-upload-artifacts/
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
with:
draft: true
tag_name: Release-v${{ steps.get_version.outputs.version-without-v }}
release_name: Release-v${{ steps.get_version.outputs.version-without-v }}
- name: Upload Releases
id: upload_release_assets
uses: dwenegar/upload-release-assets@v1 #https://github.com/marketplace/actions/upload-multiple-assets-to-a-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: ${{steps.download.outputs.download-path}}