Publish Mercury To pub.dev #12
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
name: Publish Mercury To pub.dev | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
env: | |
nodeVersion: "21" | |
pnpmVersion: "9" | |
cmakeVersion: "3.29.1" | |
flutterVersion: "3.13.4" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build_windows_binary: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.cmakeVersion }} | |
- name: Build windows dll | |
run: pnpm run build:bridge:windows:release | |
- uses: actions/[email protected] | |
with: | |
name: windows_binary | |
path: bridge/build/windows/ | |
build_linux_binary: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: jwlawson/[email protected] | |
with: | |
cmake-version: "3.22.x" | |
- run: | | |
sudo apt-get update | |
sudo apt-get install chrpath ninja-build pkg-config -y | |
- run: pnpm run build:bridge:linux:release | |
- uses: actions/[email protected] | |
with: | |
name: linux_binary | |
path: bridge/build/linux/ | |
build_macos_binary: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.cmakeVersion }} | |
- name: Build bridge binary | |
run: pnpm run build:bridge:macos:release | |
- uses: actions/[email protected] | |
with: | |
name: macos_binary | |
path: bridge/build/macos/ | |
build_ios_binary: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.cmakeVersion }} | |
- name: Build bridge binary | |
run: pnpm run build:bridge:ios:release | |
- uses: actions/[email protected] | |
with: | |
name: ios_binary | |
path: bridge/build/ios/ | |
build_android_binary: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ env.nodeVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: nttld/[email protected] | |
id: setup-ndk | |
with: | |
ndk-version: r26d | |
- uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.cmakeVersion }} | |
- name: Build bridge binary | |
run: pnpm run build:bridge:android:release | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- uses: actions/[email protected] | |
with: | |
name: android_binary | |
path: bridge/build/android/ | |
publish: | |
needs: [build_linux_binary, build_android_binary, build_ios_binary, build_macos_binary, build_windows_binary] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.flutterVersion }} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.pnpmVersion }} | |
run_install: true | |
- uses: actions/[email protected] | |
with: | |
name: linux_binary | |
path: bridge/build/linux/ | |
- uses: actions/[email protected] | |
with: | |
name: ios_binary | |
path: bridge/build/ios/ | |
- uses: actions/[email protected] | |
with: | |
name: macos_binary | |
path: bridge/build/macos/ | |
- uses: actions/[email protected] | |
with: | |
name: android_binary | |
path: bridge/build/android/ | |
- uses: actions/[email protected] | |
with: | |
name: windows_binary | |
path: bridge/build/windows/ | |
- name: Prepare distribute binaries | |
run: node scripts/pre_publish_mercury.js | |
- name: Publish | |
uses: k-paxian/dart-package-publisher@master | |
with: | |
credentialJson: ${{ secrets.CREDENTIAL_JSON }} | |
force: true | |
flutter: true | |
skipTests: true | |
relativePath: ./mercury |