-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (73 loc) · 3.09 KB
/
Copy pathdart-release.yml
File metadata and controls
90 lines (73 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Dart Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
publish:
name: Dart Release
permissions:
id-token: write # Required for requesting the JWT
contents: write # Required for creating the GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
# Set up the Dart SDK and provision the OIDC token used for publishing.
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
# Download Flutter SDK - needed for publishing Flutter packages.
# Same version as CI, so a dry run here matches what CI analyzed.
- uses: flutter-actions/setup-flutter@18c66a64fb6f6d3338c63cabbc5cd6da395e7f1d
with:
channel: stable
version: 3.47.5
# The cnativeapi package must carry core's sources: its build hook
# compiles cxx_impl/ when present (untracked, so the checkout stays clean
# and `dart pub publish` still ships it).
- name: Vendor core into cnativeapi
run: |
mkdir bindings/dart/cnativeapi/cxx_impl
git -C core archive HEAD | tar -x -C bindings/dart/cnativeapi/cxx_impl
# Publish cnativeapi
- name: Install dependencies (cnativeapi)
run: dart pub get
working-directory: bindings/dart/cnativeapi
- name: Publish - dry run (cnativeapi)
run: dart pub publish --dry-run
working-directory: bindings/dart/cnativeapi
- name: Publish cnativeapi
run: dart pub publish -f
working-directory: bindings/dart/cnativeapi
# Publish nativeapi
- name: Install dependencies (nativeapi)
run: dart pub get
working-directory: bindings/dart/nativeapi
- name: Publish - dry run (nativeapi)
run: dart pub publish --dry-run
working-directory: bindings/dart/nativeapi
- name: Publish nativeapi
run: dart pub publish -f
working-directory: bindings/dart/nativeapi
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
args=()
if [[ "$RELEASE_TAG" == *-* ]]; then args+=(--prerelease); fi
gh release create "$RELEASE_TAG" --verify-tag --generate-notes "${args[@]}"
# Publish nativeapi_flutter. Last on purpose: pub.dev only accepts a
# package's first version from `dart pub publish` run by hand, and
# automated publishing (tag pattern v{{version}}) has to be enabled on its
# admin page afterwards. Until then this step fails without holding up the
# packages and the release above.
- name: Install dependencies (nativeapi_flutter)
run: dart pub get
working-directory: bindings/dart/nativeapi_flutter
- name: Publish - dry run (nativeapi_flutter)
run: dart pub publish --dry-run
working-directory: bindings/dart/nativeapi_flutter
- name: Publish nativeapi_flutter
run: dart pub publish -f
working-directory: bindings/dart/nativeapi_flutter