12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- name : Release
15
+ name : Release Candidate
16
16
17
17
on :
18
- # Only run the workflow when a PR is closed, or when a developer explicitly requests
18
+ # Only run the workflow when a PR is updated or when a developer explicitly requests
19
19
# a build by sending a 'firebase_build' event.
20
20
pull_request :
21
21
types : [opened, synchronize, closed]
@@ -74,24 +74,43 @@ jobs:
74
74
PACKAGE_TARBALL=`ls *.tgz`
75
75
./verifyReleaseTarball.sh $PACKAGE_TARBALL
76
76
77
+ publish_release :
78
+ needs : stage_release
79
+
77
80
# Check whether the release should be published. We publish only when the trigger PR is
78
81
# 1. merged
79
82
# 2. to the master branch
80
83
# 3. with the title prefix '[chore] Release '.
81
- - name : Publish preflight check
82
- if : success() && github.event.pull_request.merged &&
84
+ if : success() && github.event.pull_request.merged &&
83
85
github.ref == 'master' &&
84
86
startsWith(github.event.pull_request.title, '[chore] Release ')
87
+
88
+ runs-on : ubuntu-latest
89
+
90
+ steps :
91
+ - name : Checkout source for publish
92
+ uses : actions/checkout@v2
93
+
94
+ # Download the artifacts created by the stage_release job.
95
+ - name : Download release candidates
96
+ uses : actions/download-artifact@v1
97
+ with :
98
+ name : dist
99
+
100
+ # Node.js and NPM are needed to complete the publish.
101
+ - name : Set up Node.js
102
+ uses : actions/setup-node@v1
103
+ with :
104
+ node-version : 8.x
105
+
106
+ - name : Publish preflight check
85
107
id : preflight
86
- run : |
87
- ./.github/scripts/publish_preflight_check.sh
88
- echo ::set-env name=FIREBASE_PUBLISH::true
108
+ run : ./.github/scripts/publish_preflight_check.sh
89
109
90
- # Tag the release if not executing in the dryrun mode. We pull this action froma
91
- # custom fork of a contributor until https://github.com/actions/create-release/pull/32
92
- # is merged. Also note that v1 of this action does not support the "body" parameter.
110
+ # We pull this action from a custom fork of a contributor until
111
+ # https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
112
+ # this action does not support the "body" parameter.
93
113
- name : Create release tag
94
- if : success() && env.FIREBASE_PUBLISH
95
114
uses : fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
96
115
env :
97
116
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -103,12 +122,11 @@ jobs:
103
122
prerelease : false
104
123
105
124
- name : Publish to NPM
106
- if : success() && env.FIREBASE_PUBLISH
107
125
run : echo Publishing to NPM
108
126
109
127
# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
110
128
- name : Post to Twitter
111
- if : success() && env.FIREBASE_PUBLISH &&
129
+ if : success() &&
112
130
contains(github.event.pull_request.labels.*.name, 'release:tweet')
113
131
run : echo Posting Tweet
114
132
continue-on-error : true
0 commit comments