Skip to content

Commit ca8ed41

Browse files
committed
Test manual merge on staging
1 parent cadc804 commit ca8ed41

File tree

1 file changed

+129
-122
lines changed

1 file changed

+129
-122
lines changed

.github/workflows/release-staging.yml

Lines changed: 129 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -15,132 +15,139 @@ jobs:
1515
uses: actions/setup-node@v2
1616
with:
1717
node-version: 14.x
18-
- name: Merge master into release
19-
uses: actions/github-script@v6
20-
with:
21-
github-token: ${{ secrets.GITHUB_TOKEN }}
22-
script: |
23-
github.rest.repos.merge({
24-
owner: context.repo.owner,
25-
repo: context.repo.repo,
26-
base: 'release',
27-
head: 'master'
28-
})
29-
- name: Checkout release branch (with history)
18+
# - name: Merge master into release
19+
# uses: actions/github-script@v6
20+
# with:
21+
# github-token: ${{ secrets.GITHUB_TOKEN }}
22+
# script: |
23+
# github.rest.repos.merge({
24+
# owner: context.repo.owner,
25+
# repo: context.repo.repo,
26+
# base: 'release',
27+
# head: 'master'
28+
# })
29+
- name: Checkout master branch (with history)
3030
uses: actions/checkout@master
3131
with:
3232
# Release script requires git history and tags.
3333
fetch-depth: 0
34-
ref: release
35-
- name: Yarn install
36-
run: yarn
37-
# Ensures a new @firebase/app is published with every release.
38-
# This keeps the SDK_VERSION variable up to date.
39-
- name: Add a changeset for @firebase/app
40-
# pull master so changeset can diff against it
34+
ref: master
35+
- name: Merge master into release
4136
run: |
42-
git pull -f --no-rebase origin master:master
43-
yarn ts-node-script scripts/ci/add_changeset.ts
44-
- name: Create Release Pull Request
45-
uses: changesets/action@v1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
48-
- name: Go back to release branch
49-
# changesets/action created and checked out a new branch
50-
# return to `release` branch.
51-
run: git checkout release
52-
- name: Publish to NPM
53-
# --skipTests No need to run tests
54-
# --skipReinstall Yarn install has already been run
55-
# --ignoreUnstaged Adding the @firebase/app changeset file means
56-
# there's unstaged changes. Ignore.
57-
# TODO: Make these flags defaults in the release script.
58-
run: yarn release --releaseType Staging --ci --skipTests --skipReinstall --ignoreUnstaged
37+
git checkout release
38+
git merge master
39+
git push origin release
5940
env:
6041
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
62-
NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
63-
NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
64-
NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
65-
NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
66-
NPM_TOKEN_APP_CHECK: ${{secrets.NPM_TOKEN_APP_CHECK}}
67-
NPM_TOKEN_APP_CHECK_INTEROP_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES}}
68-
NPM_TOKEN_APP_CHECK_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_TYPES}}
69-
NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
70-
NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
71-
NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
72-
NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
73-
NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
74-
NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
75-
NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
76-
NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
77-
NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
78-
NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
79-
NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
80-
NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
81-
NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
82-
NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
83-
NPM_TOKEN_MESSAGING_TYPES: ${{secrets.NPM_TOKEN_MESSAGING_TYPES}}
84-
NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
85-
NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
86-
NPM_TOKEN_POLYFILL: ${{secrets.NPM_TOKEN_POLYFILL}}
87-
NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
88-
NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
89-
NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
90-
NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
91-
NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
92-
NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}}
93-
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
94-
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
95-
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
96-
NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }}
97-
NPM_TOKEN_INSTALLATIONS_COMPAT: ${{ secrets.NPM_TOKEN_INSTALLATIONS_COMPAT }}
98-
NPM_TOKEN_ANALYTICS_COMPAT: ${{ secrets.NPM_TOKEN_ANALYTICS_COMPAT }}
99-
NPM_TOKEN_AUTH_COMPAT: ${{ secrets.NPM_TOKEN_AUTH_COMPAT }}
100-
NPM_TOKEN_MESSAGING_INTEROP_TYPES: ${{ secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES }}
101-
NPM_TOKEN_FUNCTIONS_COMPAT: ${{ secrets.NPM_TOKEN_FUNCTIONS_COMPAT }}
102-
NPM_TOKEN_MESSAGING_COMPAT: ${{ secrets.NPM_TOKEN_MESSAGING_COMPAT }}
103-
NPM_TOKEN_PERFORMANCE_COMPAT: ${{ secrets.NPM_TOKEN_PERFORMANCE_COMPAT }}
104-
NPM_TOKEN_REMOTE_CONFIG_COMPAT: ${{ secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT }}
105-
NPM_TOKEN_DATABASE_COMPAT: ${{ secrets.NPM_TOKEN_DATABASE_COMPAT }}
106-
NPM_TOKEN_FIRESTORE_COMPAT: ${{ secrets.NPM_TOKEN_FIRESTORE_COMPAT }}
107-
NPM_TOKEN_STORAGE_COMPAT: ${{ secrets.NPM_TOKEN_STORAGE_COMPAT }}
108-
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
109-
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
110-
CI: true
111-
- name: Get release version
112-
id: get-version
113-
# STAGING_VERSION = version with staging hash, e.g. 1.2.3-20430523
114-
# BASE_VERSION = version without staging hash, e.g. 1.2.3
115-
run: |
116-
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
117-
VERSION=`node -e "${VERSION_SCRIPT}"`
118-
echo "::set-output name=STAGING_VERSION::$VERSION"
119-
BASE_VERSION=$(echo $VERSION | cut -d "-" -f 1)
120-
echo "::set-output name=BASE_VERSION::$BASE_VERSION"
121-
- name: Echo versions in shell
122-
run: |
123-
echo "Staging release ${{ steps.get-version.outputs.STAGING_VERSION }}"
124-
echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}"
125-
- name: Launch E2E tests workflow
126-
# Trigger e2e-test.yml
127-
run: |
128-
OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }}
129-
VERSION_OR_TAG=${{ steps.get-version.outputs.STAGING_VERSION }}
130-
curl -X POST \
131-
-H "Content-Type:application/json" \
132-
-H "Accept:application/vnd.github.v3+json" \
133-
-H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \
134-
-d "{\"event_type\":\"staging-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \
135-
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches
136-
- name: Log to release tracker
137-
# Sends release information to cloud functions endpoint of release tracker.
138-
run: |
139-
DATE=$(date +'%m/%d/%Y')
140-
BASE_VERSION=${{ steps.get-version.outputs.BASE_VERSION }}
141-
STAGING_VERSION=${{ steps.get-version.outputs.STAGING_VERSION }}
142-
OPERATOR=${{ github.actor }}
143-
RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }}
144-
curl -X POST -H "Content-Type:application/json" \
145-
-d "{\"version\":\"$BASE_VERSION\",\"tag\":\"$STAGING_VERSION\",\"date\":\"$DATE\",\"operator\":\"$OPERATOR\"}" \
146-
$RELEASE_TRACKER_URL/logStaging
42+
# - name: Yarn install
43+
# run: yarn
44+
# # Ensures a new @firebase/app is published with every release.
45+
# # This keeps the SDK_VERSION variable up to date.
46+
# - name: Add a changeset for @firebase/app
47+
# # pull master so changeset can diff against it
48+
# run: |
49+
# git pull -f --no-rebase origin master:master
50+
# yarn ts-node-script scripts/ci/add_changeset.ts
51+
# - name: Create Release Pull Request
52+
# uses: changesets/action@v1
53+
# env:
54+
# GITHUB_TOKEN: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
55+
# - name: Go back to release branch
56+
# # changesets/action created and checked out a new branch
57+
# # return to `release` branch.
58+
# run: git checkout release
59+
# - name: Publish to NPM
60+
# # --skipTests No need to run tests
61+
# # --skipReinstall Yarn install has already been run
62+
# # --ignoreUnstaged Adding the @firebase/app changeset file means
63+
# # there's unstaged changes. Ignore.
64+
# # TODO: Make these flags defaults in the release script.
65+
# run: yarn release --releaseType Staging --ci --skipTests --skipReinstall --ignoreUnstaged
66+
# env:
67+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
# NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}}
69+
# NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}}
70+
# NPM_TOKEN_ANALYTICS_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_TYPES}}
71+
# NPM_TOKEN_APP: ${{secrets.NPM_TOKEN_APP}}
72+
# NPM_TOKEN_APP_TYPES: ${{secrets.NPM_TOKEN_APP_TYPES}}
73+
# NPM_TOKEN_APP_CHECK: ${{secrets.NPM_TOKEN_APP_CHECK}}
74+
# NPM_TOKEN_APP_CHECK_INTEROP_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_INTEROP_TYPES}}
75+
# NPM_TOKEN_APP_CHECK_TYPES: ${{secrets.NPM_TOKEN_APP_CHECK_TYPES}}
76+
# NPM_TOKEN_AUTH: ${{secrets.NPM_TOKEN_AUTH}}
77+
# NPM_TOKEN_AUTH_INTEROP_TYPES: ${{secrets.NPM_TOKEN_AUTH_INTEROP_TYPES}}
78+
# NPM_TOKEN_AUTH_TYPES: ${{secrets.NPM_TOKEN_AUTH_TYPES}}
79+
# NPM_TOKEN_COMPONENT: ${{secrets.NPM_TOKEN_COMPONENT}}
80+
# NPM_TOKEN_DATABASE: ${{secrets.NPM_TOKEN_DATABASE}}
81+
# NPM_TOKEN_DATABASE_TYPES: ${{secrets.NPM_TOKEN_DATABASE_TYPES}}
82+
# NPM_TOKEN_FIRESTORE: ${{secrets.NPM_TOKEN_FIRESTORE}}
83+
# NPM_TOKEN_FIRESTORE_TYPES: ${{secrets.NPM_TOKEN_FIRESTORE_TYPES}}
84+
# NPM_TOKEN_FUNCTIONS: ${{secrets.NPM_TOKEN_FUNCTIONS}}
85+
# NPM_TOKEN_FUNCTIONS_TYPES: ${{secrets.NPM_TOKEN_FUNCTIONS_TYPES}}
86+
# NPM_TOKEN_INSTALLATIONS: ${{secrets.NPM_TOKEN_INSTALLATIONS}}
87+
# NPM_TOKEN_INSTALLATIONS_TYPES: ${{secrets.NPM_TOKEN_INSTALLATIONS_TYPES}}
88+
# NPM_TOKEN_LOGGER: ${{secrets.NPM_TOKEN_LOGGER}}
89+
# NPM_TOKEN_MESSAGING: ${{secrets.NPM_TOKEN_MESSAGING}}
90+
# NPM_TOKEN_MESSAGING_TYPES: ${{secrets.NPM_TOKEN_MESSAGING_TYPES}}
91+
# NPM_TOKEN_PERFORMANCE: ${{secrets.NPM_TOKEN_PERFORMANCE}}
92+
# NPM_TOKEN_PERFORMANCE_TYPES: ${{secrets.NPM_TOKEN_PERFORMANCE_TYPES}}
93+
# NPM_TOKEN_POLYFILL: ${{secrets.NPM_TOKEN_POLYFILL}}
94+
# NPM_TOKEN_REMOTE_CONFIG: ${{secrets.NPM_TOKEN_REMOTE_CONFIG}}
95+
# NPM_TOKEN_REMOTE_CONFIG_TYPES: ${{secrets.NPM_TOKEN_REMOTE_CONFIG_TYPES}}
96+
# NPM_TOKEN_RULES_UNIT_TESTING: ${{secrets.NPM_TOKEN_RULES_UNIT_TESTING}}
97+
# NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}}
98+
# NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}}
99+
# NPM_TOKEN_TESTING: ${{secrets.NPM_TOKEN_TESTING}}
100+
# NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
101+
# NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
102+
# NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
103+
# NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }}
104+
# NPM_TOKEN_INSTALLATIONS_COMPAT: ${{ secrets.NPM_TOKEN_INSTALLATIONS_COMPAT }}
105+
# NPM_TOKEN_ANALYTICS_COMPAT: ${{ secrets.NPM_TOKEN_ANALYTICS_COMPAT }}
106+
# NPM_TOKEN_AUTH_COMPAT: ${{ secrets.NPM_TOKEN_AUTH_COMPAT }}
107+
# NPM_TOKEN_MESSAGING_INTEROP_TYPES: ${{ secrets.NPM_TOKEN_MESSAGING_INTEROP_TYPES }}
108+
# NPM_TOKEN_FUNCTIONS_COMPAT: ${{ secrets.NPM_TOKEN_FUNCTIONS_COMPAT }}
109+
# NPM_TOKEN_MESSAGING_COMPAT: ${{ secrets.NPM_TOKEN_MESSAGING_COMPAT }}
110+
# NPM_TOKEN_PERFORMANCE_COMPAT: ${{ secrets.NPM_TOKEN_PERFORMANCE_COMPAT }}
111+
# NPM_TOKEN_REMOTE_CONFIG_COMPAT: ${{ secrets.NPM_TOKEN_REMOTE_CONFIG_COMPAT }}
112+
# NPM_TOKEN_DATABASE_COMPAT: ${{ secrets.NPM_TOKEN_DATABASE_COMPAT }}
113+
# NPM_TOKEN_FIRESTORE_COMPAT: ${{ secrets.NPM_TOKEN_FIRESTORE_COMPAT }}
114+
# NPM_TOKEN_STORAGE_COMPAT: ${{ secrets.NPM_TOKEN_STORAGE_COMPAT }}
115+
# NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
116+
# NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
117+
# CI: true
118+
# - name: Get release version
119+
# id: get-version
120+
# # STAGING_VERSION = version with staging hash, e.g. 1.2.3-20430523
121+
# # BASE_VERSION = version without staging hash, e.g. 1.2.3
122+
# run: |
123+
# VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
124+
# VERSION=`node -e "${VERSION_SCRIPT}"`
125+
# echo "::set-output name=STAGING_VERSION::$VERSION"
126+
# BASE_VERSION=$(echo $VERSION | cut -d "-" -f 1)
127+
# echo "::set-output name=BASE_VERSION::$BASE_VERSION"
128+
# - name: Echo versions in shell
129+
# run: |
130+
# echo "Staging release ${{ steps.get-version.outputs.STAGING_VERSION }}"
131+
# echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}"
132+
# - name: Launch E2E tests workflow
133+
# # Trigger e2e-test.yml
134+
# run: |
135+
# OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }}
136+
# VERSION_OR_TAG=${{ steps.get-version.outputs.STAGING_VERSION }}
137+
# curl -X POST \
138+
# -H "Content-Type:application/json" \
139+
# -H "Accept:application/vnd.github.v3+json" \
140+
# -H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \
141+
# -d "{\"event_type\":\"staging-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \
142+
# https://api.github.com/repos/firebase/firebase-js-sdk/dispatches
143+
# - name: Log to release tracker
144+
# # Sends release information to cloud functions endpoint of release tracker.
145+
# run: |
146+
# DATE=$(date +'%m/%d/%Y')
147+
# BASE_VERSION=${{ steps.get-version.outputs.BASE_VERSION }}
148+
# STAGING_VERSION=${{ steps.get-version.outputs.STAGING_VERSION }}
149+
# OPERATOR=${{ github.actor }}
150+
# RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }}
151+
# curl -X POST -H "Content-Type:application/json" \
152+
# -d "{\"version\":\"$BASE_VERSION\",\"tag\":\"$STAGING_VERSION\",\"date\":\"$DATE\",\"operator\":\"$OPERATOR\"}" \
153+
# $RELEASE_TRACKER_URL/logStaging

0 commit comments

Comments
 (0)