Skip to content

Commit aa4244f

Browse files
rmi22186claude
andcommitted
chore: Add release workflows and VERSION file
Add draft-release-publish and release-from-main GitHub Actions workflows for automated pub.dev publishing via OIDC. Reformat CHANGELOG.md to Keep a Changelog format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 416bf04 commit aa4244f

4 files changed

Lines changed: 238 additions & 15 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Create draft release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump-type:
7+
description: Specify if the version should be bumped as major, minor, patch
8+
required: true
9+
type: choice
10+
options:
11+
- major
12+
- minor
13+
- patch
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
publish-draft-release:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Get current version
30+
id: version-file
31+
run: |
32+
version_from_file=$(head -n 1 VERSION)
33+
echo "release-version=$version_from_file" >> $GITHUB_OUTPUT
34+
35+
- name: Bump version
36+
id: bump-version
37+
uses: actions-ecosystem/action-bump-semver@v1
38+
with:
39+
current_version: ${{ steps.version-file.outputs.release-version }}
40+
level: ${{ github.event.inputs.bump-type || 'patch' }}
41+
42+
- name: Save validated version to file
43+
run: |
44+
echo "${{ steps.bump-version.outputs.new_version }}" > VERSION
45+
46+
- name: Update changelog
47+
uses: thomaseizinger/keep-a-changelog-new-release@v3
48+
with:
49+
tag: ${{ steps.bump-version.outputs.new_version }}
50+
51+
- name: Update pubspec.yaml
52+
run: |
53+
sed -i 's/version: .*/version: ${{ steps.bump-version.outputs.new_version }}/' pubspec.yaml
54+
55+
- name: Setup Flutter
56+
uses: subosito/flutter-action@v2
57+
with:
58+
flutter-version: ${{ vars.FLUTTER_VERSION }}
59+
channel: stable
60+
cache: true
61+
62+
- name: Run dry-run publish
63+
run: |
64+
flutter pub publish --dry-run
65+
66+
- name: Create Pull Request
67+
uses: peter-evans/create-pull-request@v7
68+
with:
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
commit-message: "chore: Prepare release ${{ steps.bump-version.outputs.new_version }}"
71+
branch: release/${{ steps.bump-version.outputs.new_version }}
72+
title: "chore: Prepare release ${{ steps.bump-version.outputs.new_version }}"
73+
base: development
74+
body: |
75+
Preparing for release ${{ steps.bump-version.outputs.new_version }}
76+
- Updated pubspec.yaml to new version
77+
- Updated CHANGELOG.md
78+
- Updated VERSION file
79+
- Ran a dry-run publish
80+
labels: |
81+
release
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Release SDK
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
paths:
8+
- VERSION
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: write
16+
id-token: write
17+
18+
jobs:
19+
test:
20+
name: Test
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Setup Flutter SDK
25+
uses: subosito/flutter-action@v2
26+
with:
27+
flutter-version: ${{ vars.FLUTTER_VERSION }}
28+
channel: stable
29+
cache: true
30+
- name: Install dependencies
31+
run: flutter pub get
32+
- name: Run tests
33+
run: flutter test
34+
35+
build-android:
36+
name: Build Android
37+
needs: test
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-java@v4
42+
with:
43+
distribution: temurin
44+
java-version: "17"
45+
cache: gradle
46+
- name: Setup Flutter SDK
47+
uses: subosito/flutter-action@v2
48+
with:
49+
flutter-version: ${{ vars.FLUTTER_VERSION }}
50+
channel: stable
51+
cache: true
52+
- name: Install example dependencies
53+
working-directory: example
54+
run: flutter pub get
55+
- name: Build example APK
56+
working-directory: example
57+
run: flutter build apk
58+
59+
build-ios:
60+
name: Build iOS
61+
needs: test
62+
runs-on: macos-15
63+
steps:
64+
- uses: actions/checkout@v4
65+
- name: Set up Xcode
66+
uses: maxim-lobanov/setup-xcode@v1
67+
with:
68+
xcode-version: latest-stable
69+
- name: Setup Flutter SDK
70+
uses: subosito/flutter-action@v2
71+
with:
72+
flutter-version: ${{ vars.FLUTTER_VERSION }}
73+
channel: stable
74+
cache: true
75+
- name: Install example dependencies
76+
working-directory: example
77+
run: flutter pub get
78+
- name: Build unsigned Xcode archive
79+
working-directory: example
80+
run: flutter build ipa --no-codesign
81+
82+
setup-and-version:
83+
needs: [build-android, build-ios]
84+
runs-on: ubuntu-latest
85+
outputs:
86+
final_version: ${{ steps.version-file.outputs.release-version }}
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v4
90+
- name: Get current version
91+
id: version-file
92+
run: |
93+
version_from_file=$(head -n 1 VERSION)
94+
echo "release-version=$version_from_file" >> $GITHUB_OUTPUT
95+
96+
release-and-tag:
97+
needs: [setup-and-version]
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Checkout repository
101+
uses: actions/checkout@v4
102+
103+
- name: Setup Flutter
104+
uses: subosito/flutter-action@v2
105+
with:
106+
flutter-version: ${{ vars.FLUTTER_VERSION }}
107+
channel: stable
108+
cache: true
109+
110+
- name: Create git tag
111+
run: |
112+
git tag "v${{ needs.setup-and-version.outputs.final_version }}"
113+
git push origin "v${{ needs.setup-and-version.outputs.final_version }}"
114+
115+
- name: Publish Package
116+
run: |
117+
flutter pub publish --force
118+
119+
- uses: ffurrer2/extract-release-notes@v2
120+
id: extract-release-notes
121+
with:
122+
changelog_file: CHANGELOG.md
123+
release_notes_file: ${{ needs.setup-and-version.outputs.final_version }}.md
124+
125+
- name: Create Github release
126+
uses: ncipollo/release-action@v1
127+
with:
128+
makeLatest: true
129+
tag: v${{ needs.setup-and-version.outputs.final_version }}
130+
body: |
131+
## Release notes:
132+
${{ steps.extract-release-notes.outputs.release_notes }}

CHANGELOG.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
## 1.1.1 (2025-11-21)
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.1.1] - 2025-11-21
211

312
* fix: SDKE-627 Return true immediately for isInitialized on iOS (#57)
413

5-
## 1.1.0 (2025-06-26)
14+
## [1.1.0] - 2025-06-26
615

716
* feat: Add support for Rokt
817
* feat: Add support for Rokt embedded layout in the Flutter SDK (#50)
@@ -12,48 +21,48 @@
1221
* feat: Add Rokt purchaseFinalized method (#54)
1322
* refactor: Update selectPlacements parameter from placementId to identifier (#55)
1423

15-
## 1.0.6 (2025-01-07)
24+
## [1.0.6] - 2025-01-07
1625

1726
* fix: Resolve linting issues (#48)
1827

19-
## 1.0.5 (2024-07-10)
28+
## [1.0.5] - 2024-07-10
2029

2130
* fix: type 'Null' is not a subtype of type 'String' in getCurrentUser (#46)
2231

23-
## 1.0.4 (2024-03-15)
32+
## [1.0.4] - 2024-03-15
2433

2534
* chore: Update Android project to Android Gradle Plugin 8.2, update dependencies (#43)
2635

27-
## 1.0.3 (2022-12-15)
36+
## [1.0.3] - 2022-12-15
2837

2938
* fix: Update mparticle_flutter_sdk.podspec (#37)
3039

31-
## 1.0.2 (2022-11-10)
40+
## [1.0.2] - 2022-11-10
3241

3342
* fix: migrate from jcenter to mavenCentral, update misc files for Android 13, update Github Actions (#34)
3443
* fix: Update license and static analysis issues (#36)
3544

36-
## 1.0.1 (2022-07-12)
45+
## [1.0.1] - 2022-07-12
3746

3847
* fix: resolve iOS mapping product attributes
39-
40-
## 1.0.0-beta.1 (2021-10-20)
48+
49+
## [1.0.0-beta.1] - 2021-10-20
4150

4251
* feat: Add support for Consent across iOS, Android, and Web
4352
* BREAKING CHANGE: From 0.2.0-alpha.1 to 1.0.0-beta - Migrated public APIs from using positional parameters to named parameters to ensure more developer-friendly APIs. See README.md for new implementation.
4453

45-
## 0.2.0-alpha.1 (2021-09-22)
54+
## [0.2.0-alpha.1] - 2021-09-22
4655

4756
* feat: Add support for eCommerce across iOS, Android, and Web
4857
* BREAKING CHANGE: From 0.1.0 to 0.2.0 - The API for custom events and screenviews has been modified to be more developer friendly. See README.md for new implementation.
4958

50-
## 0.1.0-alpha.2 (2021-08-25)
59+
## [0.1.0-alpha.2] - 2021-08-25
5160

52-
* docs: Update README.md
61+
* docs: Update README.md
5362

54-
## 0.1.0-alpha.1 (2021-08-25)
63+
## [0.1.0-alpha.1] - 2021-08-25
5564

5665
* Initial commit for open sourcing mParticle Flutter SDK
5766
* Custom event and screen event logging
5867
* Identity API (identify, login, logout, and alias)
59-
* Github Actions - semantic PR title check; plugin building
68+
* Github Actions - semantic PR title check; plugin building

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.1

0 commit comments

Comments
 (0)