fix(ci): publish packages workflows and bump version to 0.9.93 #6
Workflow file for this run
This file contains hidden or 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 flutter package | |
| on: | |
| push: | |
| tags: | |
| - '*.*.*' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| name: publish to pub.dev | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: download release assets | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| mkdir -p artifacts | |
| cd artifacts | |
| # Download all platform binaries from the GitHub release | |
| gh release download "$VERSION" --pattern "vector-*.tar.gz" | |
| # Extract all archives | |
| for archive in vector-*.tar.gz; do | |
| name=$(basename "$archive" "-$VERSION.tar.gz") | |
| mkdir -p "$name" | |
| tar -xzf "$archive" -C "$name" | |
| rm "$archive" | |
| done | |
| ls -la | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: dart-lang/setup-dart@v1.7.1 | |
| - name: assemble and publish flutter package | |
| run: | | |
| FLUTTER_DIR=packages/flutter | |
| # Android | |
| mkdir -p $FLUTTER_DIR/native_libraries/android | |
| cp artifacts/vector-android-arm64-v8a/vector.so $FLUTTER_DIR/native_libraries/android/vector_android_arm64.so | |
| cp artifacts/vector-android-armeabi-v7a/vector.so $FLUTTER_DIR/native_libraries/android/vector_android_arm.so | |
| cp artifacts/vector-android-x86_64/vector.so $FLUTTER_DIR/native_libraries/android/vector_android_x64.so | |
| # iOS device | |
| mkdir -p $FLUTTER_DIR/native_libraries/ios | |
| cp artifacts/vector-ios/vector.dylib $FLUTTER_DIR/native_libraries/ios/vector_ios_arm64.dylib | |
| # iOS simulator (keep universal/fat binary as-is) | |
| mkdir -p $FLUTTER_DIR/native_libraries/ios-sim | |
| cp artifacts/vector-ios-sim/vector.dylib $FLUTTER_DIR/native_libraries/ios-sim/vector_ios-sim.dylib | |
| # macOS (separate arch-specific dylibs) | |
| mkdir -p $FLUTTER_DIR/native_libraries/mac | |
| cp artifacts/vector-macos-arm64/vector.dylib $FLUTTER_DIR/native_libraries/mac/vector_mac_arm64.dylib | |
| cp artifacts/vector-macos-x86_64/vector.dylib $FLUTTER_DIR/native_libraries/mac/vector_mac_x64.dylib | |
| # Linux | |
| mkdir -p $FLUTTER_DIR/native_libraries/linux | |
| cp artifacts/vector-linux-x86_64/vector.so $FLUTTER_DIR/native_libraries/linux/vector_linux_x64.so | |
| cp artifacts/vector-linux-arm64/vector.so $FLUTTER_DIR/native_libraries/linux/vector_linux_arm64.so | |
| # Windows | |
| mkdir -p $FLUTTER_DIR/native_libraries/windows | |
| cp artifacts/vector-windows-x86_64/vector.dll $FLUTTER_DIR/native_libraries/windows/vector_windows_x64.dll | |
| # Update version | |
| sed -i "s/^version: .*/version: $VERSION/" $FLUTTER_DIR/pubspec.yaml | |
| # Publish to pub.dev | |
| cd $FLUTTER_DIR | |
| dart pub get | |
| dart pub publish --force |