Skip to content

Commit

Permalink
[Release 2.0.0-alpha.1] (#1527)
Browse files Browse the repository at this point in the history
* [Release 2.0.0-alpha.1]

* fix paths

* Read package version from the correct file

* More release workflow fixes

* ..

* Remove some symlink removal

* tar the correct packages

---------

Co-authored-by: nirinchev <[email protected]>
Co-authored-by: Nikola Irinchev <[email protected]>
  • Loading branch information
3 people authored Feb 27, 2024
1 parent db777ec commit 7c9dcdc
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 27 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ jobs:

- name: Check cache
id: check-cache
if: ${{ !contains(github.head_ref, 'release/') }}
uses: actions/cache@v4
with:
path: ./packages/realm_dart/binary/**
key: binaries-${{ matrix.build }}-${{ inputs.runner }}-${{hashFiles('./packages/realm_dart/src/**')}}


- name: Setup Ninja
if: contains(github.head_ref, 'release/') || steps.check-cache.outputs.cache-hit != 'true'
if: steps.check-cache.outputs.cache-hit != 'true'
uses: seanmiddleditch/gha-setup-ninja@1815f2d05c2cd60c2d900f89843139b8dde09f4c

- name: Setup Android NDK
Expand All @@ -56,7 +55,7 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app

- name: Build
if: ${{ contains(github.head_ref, 'release/') || steps.check-cache.outputs.cache-hit != 'true' }}
if: steps.check-cache.outputs.cache-hit != 'true'
run: |
cmake --preset ${{ startsWith(matrix.build, 'ios-') && 'ios' || matrix.build }}
cmake --build --preset ${{ matrix.build }} --config Release ${{ startsWith(matrix.build, 'android-') && '--target strip' || '' }}
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Read version
id: get-version
run: |
pkgVersion=$(sed -ne "s/^version: \(.*\)/\1/p" pubspec.yaml)
pkgVersion=$(sed -ne "s/^version: \(.*\)/\1/p" packages/realm_dart/pubspec.yaml)
pkgSuffix="${{ github.event.inputs.environment != 'Production' && format('-{0}', github.sha) || '' }}"
echo "version=$pkgVersion$pkgSuffix" >> $GITHUB_OUTPUT
shell: bash
Expand All @@ -40,20 +40,22 @@ jobs:
with:
workflow: ci.yml
commit: ${{ github.sha }}
path: ${{ github.workspace }}/packages/realm_dart/binary/
path: ${{ github.workspace }}/binary/
workflow_conclusion: completed

# The rename is necessary because action-download-artifact will put things in a folder named the same
# as the artifact name - i.e. librealm-linux, etc.
- name: Archive binaries
run: |
mkdir -p release
mkdir -p ${{ github.workspace }}/release
for directory in binary/*; do
targetFile="release/${directory#*-}.tar.gz"
dart run realm_dart archive --source-dir "$directory" --output-file "${{ github.workspace }}/$targetFile"
for directory in ${{ github.workspace }}/binary/*; do
artifactFolder=$(basename $directory)
targetFile="${{ github.workspace }}/release/${artifactFolder#*-}.tar.gz"
dart run realm_dart archive --source-dir "$directory" --output-file "$targetFile"
done
working-directory: packages/realm_dart
shell: bash

- name: Update realm_* path dependencies (Production)
uses: jacobtomlinson/gha-find-replace@b76729678e8d52dadb12e0e16454a93e301a919d #! 2.0.0
Expand Down Expand Up @@ -88,7 +90,7 @@ jobs:

- name: Package realm_common
run: |
cp -Lr ../package/realm_common .
cp -Lr ../packages/realm_common .
cd realm_common
dart pub publish --dry-run || true
working-directory: release
Expand All @@ -104,12 +106,9 @@ jobs:
- name: Cleanup binary symlinks
run: |
rm packages/realm/android/src/main/cpp/lib
rm packages/realm/ios/src
rm packages/realm/ios/realm_dart.xcframework
rm packages/realm/linux/binary
rm packages/realm/windows/binary
rm packages/realm/macos/librealm_dart.dylib
rm packages/realm/example/binary
- name: Package realm (flutter)
run: |
Expand All @@ -121,7 +120,7 @@ jobs:
- name: Package realm_dart
run: |
mkdir realm_dart
cp -Lr ../package/realm_dart/bin ../package/realm_dart/example ../package/realm_dart/lib ../package/realm_dart/test realm_dart
cp -Lr ../packages/realm_dart/bin ../packages/realm_dart/example ../packages/realm_dart/lib ../packages/realm_dart/test realm_dart
rsync -vt ../* realm_dart/
cd realm_dart
dart pub publish --dry-run || true
Expand Down Expand Up @@ -152,7 +151,7 @@ jobs:
- name: Upload release folder to S3
id: upload-to-s3
run: |
tar -zcvf packages.tar.gz common generator realm_dart realm ExtractedChangelog.md
tar -zcvf packages.tar.gz realm_common realm_generator realm_dart realm ExtractedChangelog.md
rm -rf common generator realm_dart realm ExtractedChangelog.md
s3_folder="static.realm.io/downloads/dart/${{ steps.get-version.outputs.version }}"
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## vNext-next (TBD)
## 2.0.0-alpha.1 (2024-02-27)

### Breaking Changes
* `RealmValue.type` is now an enum of type `RealmValueType` rather than `Type`. If you need the runtime type of the value wrapped in `RealmValue`, use `RealmValue.value.runtimeType`. (Issue [#1505](https://github.com/realm/realm-dart/issues/1505))
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: realm_example
description: Demonstrates how to use the Realm SDK for Flutter.
version: 1.9.0
version: 2.0.0-alpha.1

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/ios/realm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ puts "bundleId is #{bundleId}"

Pod::Spec.new do |s|
s.name = 'realm'
s.version = '1.9.0'
s.version = '2.0.0-alpha.1'
s.summary = 'The official Realm SDK for Flutter'
s.description = <<-DESC
Realm is a mobile database - an alternative to SQLite and key-value stores.
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/macos/realm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ puts "bundleId is #{bundleId}"

Pod::Spec.new do |s|
s.name = 'realm'
s.version = '1.9.0'
s.version = '2.0.0-alpha.1'
s.summary = 'The official Realm SDK for Flutter'
s.description = <<-DESC
Realm is a mobile database - an alternative to SQLite and key-value stores.
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: realm
description: The official Realm SDK for Flutter. Realm is a mobile database - an alternative to SQLite and key-value stores.
version: 1.9.0
version: 2.0.0-alpha.1

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/tests/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.

publish_to: "none"

version: 1.9.0
version: 2.0.0-alpha.1

environment:
sdk: ^3.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Hosts the common code shared between realm, realm_dart and realm_generator packages.
This package is part of the official Realm Flutter and Realm Dart SDKs.
version: 1.9.0
version: 2.0.0-alpha.1

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import 'options.dart';
import '../common/utils.dart';

// stamped into the library by the build system (see prepare-release.yml)
const realmCoreVersion = '13.26.0';
const realmCoreVersion = '14.0.0';

class MetricsCommand extends Command<void> {
@override
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_dart/lib/src/native/realm_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ final _pluginLib = () {
}();

// stamped into the library by the build system (see prepare-release.yml)
const libraryVersion = '1.9.0';
const libraryVersion = '2.0.0-alpha.1';

_RealmCore realmCore = _RealmCore();

Expand Down
2 changes: 1 addition & 1 deletion packages/realm_dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: realm_dart
description: The official Realm SDK for Dart. Realm is a mobile database - an alternative to SQLite and key-value stores.
version: 1.9.0
version: 2.0.0-alpha.1

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_dart/src/realm_dart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ RLM_API void realm_dart_invoke_unlock_callback(realm_userdata_t error, void* unl
// Stamped into the library by the build system (see prepare-release.yml)
// Keep this method as it is written and do not format it.
// We have a github workflow that looks for and replaces this string as it is written here.
RLM_API const char* realm_dart_library_version() { return "1.9.0"; }
RLM_API const char* realm_dart_library_version() { return "2.0.0-alpha.1"; }

//for debugging only
// RLM_API void realm_dart_gc() {
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Generates RealmObject classes from Realm data model classes.
This package is part of the official Realm Flutter and Realm Dart SDKs.
version: 1.9.0
version: 2.0.0-alpha.1

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down

0 comments on commit 7c9dcdc

Please sign in to comment.