Skip to content

Commit 75bc380

Browse files
authored
contribute a publishing automation action (#796)
* contribute a publishing automation action * update the on push tag pattern * require Dart 2.17 for protoc_plugin * Update publish.yaml
1 parent 2aa364b commit 75bc380

File tree

8 files changed

+44
-21
lines changed

8 files changed

+44
-21
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Set update schedule for GitHub Actions
2-
# See https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
1+
# Dependabot configuration file.
2+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
33

44
version: 2
55
updates:
6-
76
- package-ecosystem: "github-actions"
87
directory: "/"
98
schedule:

.github/workflows/dart.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,23 @@ jobs:
270270
- job_005
271271
- job_006
272272
job_008:
273-
name: "run_tests; linux; Dart 2.12.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
273+
name: "run_tests; linux; Dart 2.17.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
274274
runs-on: ubuntu-latest
275275
steps:
276276
- name: Cache Pub hosted dependencies
277277
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
278278
with:
279279
path: "~/.pub-cache/hosted"
280-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0;packages:protoc_plugin;commands:command_0-command_3-test_0"
280+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:protoc_plugin;commands:command_0-command_3-test_0"
281281
restore-keys: |
282-
os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0;packages:protoc_plugin
283-
os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0
282+
os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:protoc_plugin
283+
os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0
284284
os:ubuntu-latest;pub-cache-hosted
285285
os:ubuntu-latest
286286
- name: Setup Dart SDK
287287
uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
288288
with:
289-
sdk: "2.12.0"
289+
sdk: "2.17.0"
290290
- id: checkout
291291
name: Checkout repository
292292
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
@@ -525,23 +525,23 @@ jobs:
525525
- job_005
526526
- job_006
527527
job_015:
528-
name: "run_legacy_tests; linux; Dart 2.12.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test legacy_tests/generated_message_test.dart`"
528+
name: "run_legacy_tests; linux; Dart 2.17.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test legacy_tests/generated_message_test.dart`"
529529
runs-on: ubuntu-latest
530530
steps:
531531
- name: Cache Pub hosted dependencies
532532
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
533533
with:
534534
path: "~/.pub-cache/hosted"
535-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0;packages:protoc_plugin;commands:command_0-command_3-test_1"
535+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:protoc_plugin;commands:command_0-command_3-test_1"
536536
restore-keys: |
537-
os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0;packages:protoc_plugin
538-
os:ubuntu-latest;pub-cache-hosted;sdk:2.12.0
537+
os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:protoc_plugin
538+
os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0
539539
os:ubuntu-latest;pub-cache-hosted
540540
os:ubuntu-latest
541541
- name: Setup Dart SDK
542542
uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
543543
with:
544-
sdk: "2.12.0"
544+
sdk: "2.17.0"
545545
- id: checkout
546546
name: Checkout repository
547547
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

.github/workflows/publish.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
# Trigger on pull requests that target the default branch.
7+
pull_request:
8+
branches: [ master ]
9+
# Also, trigger when tags are pushed to the repo.
10+
push:
11+
tags: [ '[A-z]+-v[0-9]+.[0-9]+.[0-9]+*' ]
12+
13+
# The script below will perform publishing checks (version checks, publishing
14+
# dry run, ...) when run on a PR, and perform an actual pub publish when run as
15+
# a result of a git tag event.
16+
jobs:
17+
publish:
18+
if: ${{ github.repository_owner == 'google' }}
19+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ Package | Description | Published Version
1515
[protoc_plugin](protoc_plugin/) | A Dart back-end for the protoc compiler | [![pub package](https://img.shields.io/pub/v/protoc_plugin.svg)](https://pub.dev/packages/protoc_plugin)
1616
[api_benchmark](api_benchmark/) | Benchmarking for various API calls |
1717
[query_benchmark](query_benchmark/) | Benchmark for encoding and decoding of a "real-world" protobuf |
18+
19+
## Publishing automation
20+
21+
For information about our publishing automation and release process, see
22+
https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

protobuf/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: protobuf
22
version: 3.0.0-dev
33
description: >-
4-
Runtime library for protocol buffers support.
5-
Use https://pub.dev/packages/protoc_plugin to generate dart code for your '.proto' files.
4+
Runtime library for protocol buffers support. Use with package:protoc_plugin
5+
to generate dart code for your '.proto' files.
66
repository: https://github.com/google/protobuf.dart/tree/master/protobuf
77

88
environment:

protoc_plugin/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Remove message constructor arguments. Constructors with arguments cause
77
increase in release binary sizes even when no arguments are passed to the
88
constructors. ([#703])
9+
* Require Dart `2.17`.
910

1011
**Migration:**
1112

protoc_plugin/pubspec.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: protoc_plugin
22
version: 21.0.0-dev
3-
description: Protoc compiler plugin to generate Dart code
3+
description: A protobuf protoc compiler plugin used to generate Dart code.
44
repository: https://github.com/google/protobuf.dart/tree/master/protoc_plugin
55

66
environment:
7-
sdk: '>=2.12.0 <3.0.0'
7+
sdk: '>=2.17.0 <3.0.0'
88

99
dependencies:
1010
fixnum: ^1.0.0
@@ -19,7 +19,3 @@ dev_dependencies:
1919

2020
executables:
2121
protoc-gen-dart: protoc_plugin
22-
23-
dependency_overrides:
24-
protobuf:
25-
path: ../protobuf
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependency_overrides:
2+
protobuf:
3+
path: ../protobuf

0 commit comments

Comments
 (0)