Skip to content

Commit 97e1725

Browse files
committed
v
1 parent 0738e18 commit 97e1725

File tree

4 files changed

+57
-22
lines changed

4 files changed

+57
-22
lines changed

.github/workflows/flutter-release.yml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
name: Flutter Release
22

3+
# Workflow: Create GitHub Release first (with tag v*), then run this workflow manually
4+
# pub.dev OIDC only works with 'push' or 'workflow_dispatch' events, not 'release'
35
on:
4-
release:
5-
types: [created]
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: 'Version to publish (e.g., 0.2.0)'
10-
required: true
9+
description: 'Version to publish (leave empty to use latest release tag)'
10+
required: false
1111
type: string
12+
dry_run:
13+
description: 'Dry run (do not actually publish)'
14+
required: false
15+
type: boolean
16+
default: false
1217

1318
env:
1419
CARGO_TERM_COLOR: always
1520
FLUTTER_VERSION: '3.24.0'
1621

1722
jobs:
23+
# Get version from input or latest release
24+
get-version:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
version: ${{ steps.version.outputs.version }}
28+
steps:
29+
- name: Get version
30+
id: version
31+
env:
32+
GH_TOKEN: ${{ github.token }}
33+
run: |
34+
if [ -n "${{ inputs.version }}" ]; then
35+
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
36+
echo "Using provided version: ${{ inputs.version }}"
37+
else
38+
# Get latest release tag and strip 'v' prefix
39+
LATEST=$(gh release view --repo ${{ github.repository }} --json tagName -q '.tagName' | sed 's/^v//')
40+
echo "version=$LATEST" >> $GITHUB_OUTPUT
41+
echo "Using latest release version: $LATEST"
42+
fi
43+
1844
# Generate Dart bindings
1945
generate-bindings:
46+
needs: get-version
2047
runs-on: ubuntu-latest
2148
steps:
2249
- uses: actions/checkout@v4
@@ -61,6 +88,7 @@ jobs:
6188

6289
# Build Android native libraries
6390
build-android:
91+
needs: get-version
6492
runs-on: ubuntu-latest
6593
strategy:
6694
matrix:
@@ -136,6 +164,7 @@ jobs:
136164

137165
# Build iOS native libraries
138166
build-ios:
167+
needs: get-version
139168
runs-on: macos-latest
140169
steps:
141170
- uses: actions/checkout@v4
@@ -191,6 +220,7 @@ jobs:
191220

192221
# Build WASM package
193222
build-wasm:
223+
needs: get-version
194224
runs-on: ubuntu-latest
195225
steps:
196226
- uses: actions/checkout@v4
@@ -213,22 +243,13 @@ jobs:
213243
cd crates/fula-flutter
214244
wasm-pack build --release --target web --out-dir ../../wasm-package
215245
216-
- name: Get version
217-
id: version
218-
run: |
219-
if [ "${{ github.event_name }}" = "release" ]; then
220-
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
221-
else
222-
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
223-
fi
224-
225246
- name: Create npm package.json
226247
run: |
227248
cd wasm-package
228249
cat > package.json << INNEREOF
229250
{
230251
"name": "@functionland/fula-client",
231-
"version": "${{ steps.version.outputs.version }}",
252+
"version": "${{ needs.get-version.outputs.version }}",
232253
"description": "Fula encrypted storage SDK for JavaScript/WASM",
233254
"main": "fula_flutter.js",
234255
"types": "fula_flutter.d.ts",
@@ -305,11 +326,12 @@ jobs:
305326
du -sh packages/fula_client/
306327
307328
- name: Publish to pub.dev (dry run)
329+
if: inputs.dry_run
308330
working-directory: packages/fula_client
309331
run: flutter pub publish --dry-run
310332

311333
- name: Publish to pub.dev
312-
if: github.event_name == 'release'
334+
if: ${{ !inputs.dry_run }}
313335
working-directory: packages/fula_client
314336
run: flutter pub publish --force
315337

@@ -337,23 +359,24 @@ jobs:
337359
cat wasm-package/package.json
338360
339361
- name: Publish to npm (dry run)
362+
if: inputs.dry_run
340363
working-directory: wasm-package
341364
run: npm publish --access public --dry-run
342365
env:
343366
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
344367

345368
- name: Publish to npm
346-
if: github.event_name == 'release'
369+
if: ${{ !inputs.dry_run }}
347370
working-directory: wasm-package
348371
run: npm publish --access public
349372
env:
350373
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
351374

352-
# Create GitHub Release artifacts
353-
github-release:
354-
needs: [build-android, build-ios, build-wasm]
375+
# Upload artifacts to existing GitHub Release
376+
upload-release-assets:
377+
needs: [get-version, build-android, build-ios, build-wasm]
355378
runs-on: ubuntu-latest
356-
if: github.event_name == 'release'
379+
if: ${{ !inputs.dry_run }}
357380
steps:
358381
- name: Download all artifacts
359382
uses: actions/download-artifact@v4
@@ -382,6 +405,7 @@ jobs:
382405
- name: Upload to GitHub Release
383406
uses: softprops/action-gh-release@v1
384407
with:
408+
tag_name: v${{ needs.get-version.outputs.version }}
385409
files: |
386410
artifacts/android-libs.zip
387411
artifacts/ios-libs.zip

packages/fula_client/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.4] - 2026-01-11
9+
10+
### Changed
11+
12+
- Release workflow now uses workflow_dispatch for pub.dev OIDC compatibility
13+
- Create GitHub Release first, then run workflow to publish
14+
15+
### Fixed
16+
17+
- pub.dev OIDC authentication now works (requires workflow_dispatch event)
18+
819
## [0.2.3] - 2026-01-11
920

1021
### Changed

packages/fula_client/ios/fula_client.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Pod::Spec.new do |s|
88
s.name = 'fula_client'
9-
s.version = '0.2.3'
9+
s.version = '0.2.4'
1010
s.summary = 'Flutter SDK for Fula decentralized storage'
1111
s.description = <<-DESC
1212
A Flutter plugin providing client-side encryption, metadata privacy,

packages/fula_client/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: fula_client
22
description: Flutter SDK for Fula decentralized storage with client-side encryption, metadata privacy, and secure sharing.
3-
version: 0.2.3
3+
version: 0.2.4
44
homepage: https://fx.land
55
repository: https://github.com/functionland/fula-api
66
issue_tracker: https://github.com/functionland/fula-api/issues

0 commit comments

Comments
 (0)