Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ jobs:

runs-on: ubuntu-latest

# When manually triggering the build, the requester can specify a target branch or a tag
# via the 'ref' client parameter.
steps:
- name: Check out code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ github.event.client_payload.ref || github.ref }}

- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
Expand Down Expand Up @@ -71,19 +67,19 @@ jobs:
# 3. with the label 'release:publish', and
# 4. the title prefix '[chore] Release '.
if: github.event.pull_request.merged &&
github.ref == 'refs/heads/dev' &&
github.base_ref == 'dev' &&
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
startsWith(github.event.pull_request.title, '[chore] Release ')

runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout source for publish
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: dev
persist-credentials: false

- name: Publish preflight check
Expand All @@ -94,10 +90,11 @@ jobs:
- name: Create Release PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BODY: ${{ steps.preflight.outputs.changelog }}
RELEASE_TITLE: "[chore] Release ${{ steps.preflight.outputs.version }}"
run: |
gh pr create \
--base master \
--head dev \
--title "[chore] Release ${{ steps.preflight.outputs.version }}" \
--body "${{ steps.preflight.outputs.changelog }}" \
--label "release:tag"
--title "$RELEASE_TITLE" \
--body "$RELEASE_BODY"
27 changes: 11 additions & 16 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@
name: Tag Release

on:
pull_request:
types: [closed]
push:
branches:
- master
paths:
- 'firebase.go'

jobs:
tag_release:
# Trigger only when:
# 1. The PR is merged.
# 2. The PR targets the master branch.
# 3. The PR has the label 'release:tag'.
if: github.event.pull_request.merged &&
github.event.pull_request.base.ref == 'master' &&
contains(github.event.pull_request.labels.*.name, 'release:tag') &&
startsWith(github.event.pull_request.title, '[chore] Release ')
if: startsWith(github.event.head_commit.message, '[chore] Release ')

runs-on: ubuntu-latest
environment: Release
Expand All @@ -37,18 +33,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: master

- name: Publish preflight check
id: preflight
run: ./.github/scripts/publish_preflight_check.sh

# See: https://cli.github.com/manual/gh_release_create
- name: Create release tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ steps.preflight.outputs.version }}
--title "Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}"
--notes '${{ steps.preflight.outputs.changelog }}'
RELEASE_VER: ${{ steps.preflight.outputs.version }}
RELEASE_NOTES: ${{ steps.preflight.outputs.changelog }}
run: gh release create "$RELEASE_VER" \
--title "Firebase Admin Go SDK $RELEASE_VER" \
--notes "$RELEASE_NOTES" \
--target "master"
Loading