@@ -28,7 +28,7 @@ to use in some environments, but also pose a larger risk if accidentally leaked.
28
28
{{site.alert.end}}
29
29
30
30
31
- ## Publishing packages using Github Actions
31
+ ## Publishing packages using GitHub Actions
32
32
33
33
You can configure automated publishing using GitHub Actions. This involves:
34
34
* Enabling automated publishing on pub.dev, specifying:
@@ -61,21 +61,21 @@ If you have sufficient permission, you can enable automated publishing by:
61
61
1 . Click ** Enable publishing from GitHub Actions** , this prompts you to
62
62
specify:
63
63
* A repository (` <organization>/<repository> ` , example: ` dart-lang/pana ` ),
64
- * A _ tag-pattern_ (a string containing ` {% raw %}{{version}}{% raw %} ` ).
64
+ * A _ tag-pattern_ (a string containing ` {% raw %}{{version}}{% endraw %} ` ).
65
65
66
- The _ repository_ is the ` <organization>/<repository> ` on Github .
66
+ The _ repository_ is the ` <organization>/<repository> ` on GitHub .
67
67
For example, if your repository is
68
68
` https://github.com/dart-lang/pana ` you must specify ` dart-lang/pana ` in the
69
69
repository field.
70
70
71
- The _ tag pattern_ is a string that must contain ` {% raw %}{{version}}{% raw %} ` .
72
- Only Github Actions triggered by a push of a tag that matches this
71
+ The _ tag pattern_ is a string that must contain ` {% raw %}{{version}}{% endraw %} ` .
72
+ Only GitHub Actions triggered by a push of a tag that matches this
73
73
_ tag pattern_ will be allowed to publish your package.
74
74
75
- [ ! Configuration of publishing from GitHub Actions on pub.dev] ( pub-dev-gh-setup.png )
75
+ ![ Configuration of publishing from GitHub Actions on pub.dev] ( pub-dev-gh-setup.png )
76
76
77
- ** Example:** a _ tag pattern_ like ` v{% raw %}{{version}}{% raw %} ` allows
78
- Github Actions (triggered by ` git tag v1.2.3 && git push v1.2.3 ` ) to publish
77
+ ** Example:** a _ tag pattern_ like ` v{% raw %}{{version}}{% endraw %} ` allows
78
+ GitHub Actions (triggered by ` git tag v1.2.3 && git push v1.2.3 ` ) to publish
79
79
version ` 1.2.3 ` of your package. Thus, it's also important that the ` version ` key in
80
80
` pubspec.yaml ` matches this version number.
81
81
@@ -171,13 +171,13 @@ To publish to pub.dev, subsequent steps can run `dart pub publish --force`.
171
171
[sec-gh-environment] : # hardening-security-with-github-deployment-environments
172
172
173
173
174
- # ## Triggering automated publishing from Github Actions
174
+ # ## Triggering automated publishing from GitHub Actions
175
175
176
176
After you've configured automated publishing on `pub.dev` and created a
177
177
GitHub Actions workflow, you can publish a new version of your package.
178
178
To publish, push a _git tag_ matching the configured _tag pattern_.
179
179
180
- ` ` ` console
180
+ ` ` ` terminal
181
181
$ cat pubspec.yaml
182
182
package: my_package_name
183
183
version: 1.2.3 # must match the version number used in the git tag
@@ -200,7 +200,7 @@ Once published, you can see the publication event in the `audit-log` on
200
200
The `audit-log` entry should contain a link to the GitHub Action run that
201
201
published the package version.
202
202
203
- [! Audit log after publishing from GitHub Actions](audit-log-pub-gh.png)
203
+ 
204
204
205
205
If you don't like using the `git` CLI to create tags, you can create _releases_
206
206
on GitHub from `https://github.com/<organization>/<repository>/releases/new`.
@@ -233,7 +233,7 @@ To require a _GitHub Actions environment_ for publishing you must:
233
233
1. Click **Require GitHub Actions environment**.
234
234
1. Specify an **Environment** name, (`pub.dev` is typically a good name)
235
235
236
- [! Configure pub.dev to require a GitHub deployment environment](pub-dev-gh-env-setup.png)
236
+ 
237
237
238
238
When an environment is required on pub.dev, GitHub Actions won't be able to
239
239
publish unless they have `environment : pub.dev`. Thus, you must:
@@ -271,7 +271,7 @@ configure _required reviewers_. If you configure this option, GitHub prevents
271
271
actions with the environment from running until one of the
272
272
_required reviewers_ have approved the run.
273
273
274
- [! GitHub Action waiting for deployment review](gh-pending-review.png)
274
+ 
275
275
276
276
277
277
# # Publishing from Google Cloud Build
@@ -329,7 +329,7 @@ grant Cloud Build permission to impersonate this service account.
329
329
You created this account in the previous step :
330
330
` pub-dev@$PROJECT_ID.iam.gserviceaccount.com`
331
331
332
- [! Configuration that allows service account to publish on pub.dev](pub-dev-gcb-config.png)
332
+ 
333
333
334
334
With this procedure complete, anyone who can impersonate the service account can
335
335
publish new versions of the package. Make sure to review who has permissions to
@@ -443,7 +443,7 @@ repository in the `/cloudbuild.yaml` file.
443
443
Do **not** specify a _service account_ for the build to be triggered with.
444
444
Instead you'll want to use the default service account for Cloud Build.
445
445
446
- [! Configuration for trigger](gcb-trigger-configuration.png)
446
+ 
447
447
448
448
{{site.alert.note}}
449
449
You can configure the Cloud Build trigger to run under a custom
@@ -477,12 +477,12 @@ requires approval, it won't run when triggered. Instead, it'll wait for
477
477
approval.
478
478
This can be used to limit who can publish new versions of your package.
479
479
480
- [! Enabling approvals in configuration of the Cloud Build trigger](gcb-approval-checkbox.png)
480
+ 
481
481
482
482
Only a user with the **Cloud Build Approver** role can give approval.
483
483
When giving a approval, the approver can specify a URL and comment.
484
484
485
- [! Cloud Build run waiting for approval to run](gcp-waiting-for-approval.png)
485
+ 
486
486
487
487
You can also configure notifications for pending approvals.
488
488
To learn more, check out [gate build on approval][17].
@@ -491,7 +491,7 @@ To learn more, check out [gate build on approval][17].
491
491
# # Publish from anywhere using a Service Account
492
492
493
493
To allow automated publishing outside of GitHub Actions, you might
494
- authenticate using service accounts in way similiar to _Cloud Build_.
494
+ authenticate using service accounts in way similar to _Cloud Build_.
495
495
496
496
This usually involves :
497
497
* [Create a service account for publishing][create-svc],
0 commit comments