Skip to content

Commit 5e861fd

Browse files
[chore] Release 4.12.1 take 3 (#585)
- Fixes the release workflow to match the updates to`github.ref`. - `github.ref` now returns a fully-formed value `refs/heads/dev` instead of just `dev`. - See https://github.blog/changelog/2023-09-13-github-actions-updates-to-github_ref-and-github-ref/
1 parent f1a8863 commit 5e861fd

File tree

1 file changed

+46
-67
lines changed

1 file changed

+46
-67
lines changed

.github/workflows/release.yml

+46-67
Original file line numberDiff line numberDiff line change
@@ -70,83 +70,62 @@ jobs:
7070
# 2. to the dev branch
7171
# 3. with the label 'release:publish', and
7272
# 4. the title prefix '[chore] Release '.
73-
# if: github.event.pull_request.merged &&
74-
# github.ref == 'dev' &&
75-
# contains(github.event.pull_request.labels.*.name, 'release:publish') &&
76-
# startsWith(github.event.pull_request.title, '[chore] Release ')
77-
#
73+
if: github.event.pull_request.merged &&
74+
github.ref == 'refs/heads/dev' &&
75+
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
76+
startsWith(github.event.pull_request.title, '[chore] Release ')
7877

7978
runs-on: ubuntu-latest
8079

8180
steps:
82-
- name: github.ref
83-
run: echo ${{ github.ref }}
84-
85-
- name: github.event.pull_request.merged
86-
run: echo ${{ github.event.pull_request.merged }}
87-
88-
- name: contains(github.event.pull_request.labels.*.name, 'release:publish')
89-
run: echo ${{ contains(github.event.pull_request.labels.*.name, 'release:publish') }}
90-
91-
- name: startsWith(github.event.pull_request.title, '[chore] Release ')
92-
run: echo ${{ startsWith(github.event.pull_request.title, '[chore] Release ') }}
93-
94-
- name: check all conditions
95-
run: echo 'all true'
96-
if: github.event.pull_request.merged &&
97-
github.ref == 'dev' &&
98-
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
99-
startsWith(github.event.pull_request.title, '[chore] Release ')
100-
101-
# steps:
102-
# - name: Checkout source for publish
103-
# uses: actions/checkout@v2
104-
# with:
105-
# persist-credentials: false
81+
- name: Checkout source for publish
82+
uses: actions/checkout@v2
83+
with:
84+
persist-credentials: false
10685

107-
# - name: Publish preflight check
108-
# id: preflight
109-
# run: ./.github/scripts/publish_preflight_check.sh
86+
- name: Publish preflight check
87+
id: preflight
88+
run: ./.github/scripts/publish_preflight_check.sh
11089

11190
# We authorize this step with an access token that has write access to the master branch.
112-
# - name: Merge to master
113-
# uses: actions/[email protected]
114-
# with:
115-
# github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }}
116-
# script: |
117-
# github.repos.merge({
118-
# owner: context.repo.owner,
119-
# repo: context.repo.repo,
120-
# base: 'master',
121-
# head: 'dev'
122-
# })
91+
- name: Merge to master
92+
uses: actions/[email protected]
93+
with:
94+
github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }}
95+
script: |
96+
github.repos.merge({
97+
owner: context.repo.owner,
98+
repo: context.repo.repo,
99+
base: 'master',
100+
head: 'dev'
101+
})
123102
124103
# We pull this action from a custom fork of a contributor until
125104
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
126105
# this action does not support the "body" parameter.
127-
# - name: Create release tag
128-
# uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
129-
# env:
130-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131-
# with:
132-
# tag_name: ${{ steps.preflight.outputs.version }}
133-
# release_name: Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}
134-
# body: ${{ steps.preflight.outputs.changelog }}
135-
# commitish: master
136-
# draft: false
137-
# prerelease: false
106+
- name: Create release tag
107+
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
with:
111+
tag_name: ${{ steps.preflight.outputs.version }}
112+
release_name: Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}
113+
body: ${{ steps.preflight.outputs.changelog }}
114+
commitish: master
115+
draft: false
116+
prerelease: false
138117

139118
# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
140-
# - name: Post to Twitter
141-
# if: success() &&
142-
# contains(github.event.pull_request.labels.*.name, 'release:tweet')
143-
# uses: firebase/firebase-admin-node/.github/actions/send-tweet@master
144-
# with:
145-
# status: >
146-
# ${{ steps.preflight.outputs.version }} of @Firebase Admin Go SDK is available.
147-
# https://github.com/firebase/firebase-admin-go/releases/tag/${{ steps.preflight.outputs.version }}
148-
# consumer-key: ${{ secrets.FIREBASE_TWITTER_CONSUMER_KEY }}
149-
# consumer-secret: ${{ secrets.FIREBASE_TWITTER_CONSUMER_SECRET }}
150-
# access-token: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN }}
151-
# access-token-secret: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN_SECRET }}
152-
# continue-on-error: true
119+
- name: Post to Twitter
120+
if: success() &&
121+
contains(github.event.pull_request.labels.*.name, 'release:tweet')
122+
uses: firebase/firebase-admin-node/.github/actions/send-tweet@master
123+
with:
124+
status: >
125+
${{ steps.preflight.outputs.version }} of @Firebase Admin Go SDK is available.
126+
https://github.com/firebase/firebase-admin-go/releases/tag/${{ steps.preflight.outputs.version }}
127+
consumer-key: ${{ secrets.FIREBASE_TWITTER_CONSUMER_KEY }}
128+
consumer-secret: ${{ secrets.FIREBASE_TWITTER_CONSUMER_SECRET }}
129+
access-token: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN }}
130+
access-token-secret: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN_SECRET }}
131+
continue-on-error: true

0 commit comments

Comments
 (0)