ci: build again in package script #52
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a GitHub Actions configuration file | |
name: release-packages | |
on: | |
push: | |
# branches: | |
# - dev | |
# - main | |
tags: | |
- 'dev-v[0-9]+\.[0-9]+\.[0-9]+' | |
- 'release-v[0-9]+\.[0-9]+\.[0-9]+' | |
jobs: | |
build-on-macos: | |
name: MacOS, ios | |
runs-on: macos-latest | |
steps: | |
- name: check code | |
uses: actions/checkout@v3 | |
- name: set flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
architecture: x64 # optional, x64 or arm64 | |
- run: flutter pub get | |
- name: install create-dmg | |
run: npm install --global create-dmg | |
# Flutter macos/ios ipa build command. | |
- run: flutter build macos | |
- run: | | |
flutter build ios --no-codesign | |
cd build/ios/iphoneos | |
mkdir Payload | |
cd Payload | |
ln -s ../Runner.app | |
cd .. | |
zip -r app.ipa Payload | |
- name: package as dmg | |
run: create-dmg build/macos/Build/Products/Release/whisper.app | |
continue-on-error: true | |
- name: rename dmg | |
run: mv whisper*.dmg whisper-x86_64.dmg | |
# - run: | | |
# hdiutil create -format UDZO -srcfolder \ | |
# build/macos/Build/Products/Release/whisper.app \ | |
# build/macos/Build/Products/Release/whisper-x86_64.dmg | |
# Upload assets to release | |
- name: Push to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "whisper-x86_64.dmg,build/ios/iphoneos/app.ipa" | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.TOKEN }} | |
allowUpdates: true | |
build-on-windows: | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
# New step to install NSIS | |
- name: Install NSIS | |
run: choco install nsis | |
- run: flutter config --enable-windows-desktop | |
- run: flutter build windows | |
# New step to create the installer using NSIS | |
- name: Create EXE Installer | |
run: makensis windows\installer.nsi | |
# New step to verify the EXE installer exists | |
- name: Check if file exists | |
run: | | |
$path = "windows\whisper-windows-x86_64.exe" | |
if (Test-Path $path) { | |
Write-Host "File exists" | |
} else { | |
Write-Host "File does not exist" | |
} | |
# Modified Push to Release step to upload the EXE installer | |
- name: Push to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "windows/whisper-windows-x86_64.exe" | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.TOKEN }} | |
allowUpdates: true | |
build-on-linux: | |
name: Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: check code | |
uses: actions/checkout@v3 | |
- name: set java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: set flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
architecture: x64 # optional, x64 or arm64 | |
- run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
sudo apt-get install -y alien | |
- run: flutter config --enable-linux-desktop | |
- run: flutter build linux | |
- name: set variable cur_version | |
run: echo "cur_version=$(echo '${{github.ref_name}}' | cut -d'-' -f2 | sed 's/^v//')" >> $GITHUB_ENV | |
# New step to compress the release bundle | |
- name: build deb package | |
run: chmod +x linux/build_deb.sh && sh linux/build_deb.sh $cur_version amd64 | |
- name: build rpm package | |
run: sudo alien -r build/linux/deb/whisper-${cur_version}-amd64.deb && mv whisper-${cur_version}-2.x86_64.rpm whisper-${cur_version}.x86_64.rpm | |
- name: prepare for sign | |
run: chmod +x android/append_local_properties.sh && sh android/append_local_properties.sh ${{ secrets.KEY_PASSWORD }} ${{ secrets.STORE_PASSWORD }} | |
env: | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEYSTORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | |
- name: build android common package | |
run: flutter build apk | |
- name: build android packages with platform | |
run: flutter build apk --split-per-abi | |
# Modified Push to Release step to upload the tar.gz file | |
- name: Push to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
# Specify the path to the tar.gz file instead of the folder | |
artifacts: "whisper-${{ env.cur_version }}.x86_64.rpm,build/linux/deb/whisper-${{ env.cur_version }}-amd64.deb,build/app/outputs/flutter-apk/*" | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.TOKEN }} | |
allowUpdates: true |