Skip to content

Commit 98a55e2

Browse files
authored
chore: move dart release to its own file (#398)
* chore: move dart release to its own file * chore: u
1 parent 0669e1d commit 98a55e2

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
id-token: write # Required for authentication using OIDC
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
# with:
14+
# working-directory: path/to/package/within/repository
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
id-token: write # Required for authentication using OIDC
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
# with:
14+
# working-directory: path/to/package/within/repository

scripts/generate.sh

+2
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ dart () {
257257

258258
# Generate the `*.g.dart` files
259259
(cd $dir; command dart run build_runner build)
260+
261+
cp -r contrib/dart/. ${dir}/
260262
}
261263

262264
rust () {

scripts/release.sh

-24
Original file line numberDiff line numberDiff line change
@@ -195,30 +195,6 @@ dotnet() {
195195

196196
dart() {
197197
dir="clients/${PROJECT}/dart"
198-
mkdir -p "$HOME/.pub-cache" || true
199-
set +x
200-
201-
if [ -z ${DART_SERVICE_ACCOUNT+x} ]; then echo "Variable DART_SERVICE_ACCOUNT MUST be set."; fi
202-
203-
echo "$DART_SERVICE_ACCOUNT" | base64 -d > "$HOME/.pub-cache/key-file.json"
204-
205-
# To generate this key run:
206-
#
207-
# gcloud iam service-accounts keys create key-file.json \
208-
# --project=ory-web \
209-
210-
# base64 key-file.json | pbcopy
211-
#
212-
# And copy it into the DART_SERVICE_ACCOUNT secret.
213-
214-
gcloud auth activate-service-account --key-file="$HOME/.pub-cache/key-file.json"
215-
export DART_PUB_TOKEN=$(gcloud auth print-identity-token --audiences=https://pub.dev)
216-
gcloud auth print-identity-token \
217-
--audiences=https://pub.dev \
218-
| command dart pub token add https://pub.dev
219-
set -x
220-
221-
(cd "${dir}"; VERSION=${RAW_VERSION} command dart pub publish --force)
222198
to_git "dart" "yes"
223199
}
224200

0 commit comments

Comments
 (0)