Skip to content

Commit

Permalink
more fixes (#53)
Browse files Browse the repository at this point in the history
* more fixes

* more fixes
  • Loading branch information
evandcoleman authored Sep 30, 2024
1 parent 3c369b7 commit 4358c33
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Download artifacts from latest build run
- name: Create release
if: steps.check_release.outputs.exists == 'false'
run: |
branch_name=release/$VERSION
Expand All @@ -48,39 +48,30 @@ jobs:
echo "Getting build workflow run for branch: $branch_name"
# Get the latest workflow run ID for the branch
run_id=$(gh api repos/${{ github.repository }}/actions/runs \
--paginate \
--jq ".workflow_runs[] | select(.head_branch == \"$branch_name\" and .name == \"$workflow_name\") | .id" | head -n 1)
run_id=$(gh run list --branch $branch_name --workflow "Build Release" --limit 1 --json databaseId | jq -r '.[0].databaseId')
if [ -z "$run_id" ]; then
echo "No build workflow run found for branch $branch_name"
exit 1
else
echo "Found build workflow run ID: $run_id"

# Download all artifacts from the workflow run
gh run download $run_id --repo ${{ github.repository }} --dir ./artifacts/

echo "Creating a release for version $version"

firebase_release_id=$(gh api repos/$FIREBASE_REPO/releases/tags/$VERSION --jq '.id')
release_notes=$(gh release view $release_id --repo $FIREBASE_REPO --json body | jq -r '.body')

# Create a new release
gh release create $version ./artifacts/* \
--title "$version" \
--notes "$release_notes"
fi

# Download all artifacts from the workflow run
gh run download $run_id --repo ${{ github.repository }} --dir ./artifacts/
env:
VERSION: ${{ steps.latest_firebase_release.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release and upload artifacts
if: steps.check_release.outputs.exists == 'false'
run: |
echo "Creating a release for version $version"
firebase_release_id=$(gh api repos/$FIREBASE_REPO/releases/tags/$VERSION --jq '.id')
release_notes=$(gh release view $release_id --repo $FIREBASE_REPO --json body | jq -r '.body')
# Create a new release
gh release create $version ./artifacts/* \
--title "$version" \
--notes "$release_notes"
env:
FIREBASE_REPO: firebase/firebase-ios-sdk
VERSION: ${{ steps.latest_firebase_release.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


0 comments on commit 4358c33

Please sign in to comment.