Skip to content

release notes fixes (#79) #30

release notes fixes (#79)

release notes fixes (#79) #30

Workflow file for this run

name: Build Release
on:
workflow_dispatch:
push:
branches:
- 'release/*'
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from branch name
id: extract_version
run: |
branch_name=${{ github.ref_name }}
if [[ "$branch_name" == release/* ]]; then
version=${branch_name#release/}
echo "Version: $version"
echo "::set-output name=version::${version}"
else
echo "Not a release branch."
exit 1
fi
- name: Download release artifact
id: download_artifact
run: |
artifact_name="Firebase.zip"
echo "Getting release notes for $REPO version $VERSION"
echo "Release ID: $release_id"
echo "Getting release notes for $REPO version $VERSION"
# Get release notes
gh release view $VERSION --repo $REPO --json body | jq -r '.body' >> release_notes.txt
echo "Downloading artifact from $REPO version $VERSION"
# Download the release artifact for that release ID
gh release download $VERSION --repo $REPO --pattern $artifact_name --dir ./
env:
REPO: firebase/firebase-ios-sdk
VERSION: ${{ steps.extract_version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Package release
run: |
cd .scripts
sh ./package.sh
cd ..
git add .
git commit -m "Updated Package.swift and sources for latest firebase sdks"
git push -u origin release/$VERSION
env:
VERSION: ${{ steps.extract_version.outputs.version }}
REPO: https://github.com/${{ github.repository }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Firebase
path: artifacts/*
- name: Open pull request
run: |
gh pr create --title "Update to Firebase $VERSION" --body-file release_notes.txt --base main --head release/$VERSION
echo "::set-output name=number::${number}"
env:
VERSION: ${{ steps.extract_version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve pull request
run: |
gh pr review --approve
env:
GITHUB_TOKEN: ${{ secrets.AFRESHY_PAT }}
- name: Merge pull request
run: |
gh pr merge --squash
env:
GITHUB_TOKEN: ${{ secrets.AFRESHY_PAT }}