Skip to content

Commit

Permalink
Update release notes action for new release model
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelgrom committed Jul 12, 2023
1 parent dbae8d2 commit 622130b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/actions/create-release-notes/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: 'Create Release Notes'
description: 'Creates the current releases release notes'
inputs:
tag-name:
description: 'Name of the tag that will be used for this release'
required: true
runs:
using: 'composite'
steps:
Expand All @@ -9,15 +13,30 @@ runs:
run: |
mkdir -p ./app/build/outputs/
echo "Previous Release Commit:"
git tag -l --sort=-creatordate | grep -v beta- | head -n 1
previous=`git tag -l --sort=-creatordate | grep -v beta- | head -n 1`
echo "Previous Release Tag:"
TAG=`\
curl --no-progress-meter --request GET \
--url "https://api.github.com/repos/home-assistant/android/releases/latest" \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $GH_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
| jq -r .tag_name
`
echo $TAG
echo "# Changes:" > ./app/build/outputs/changelogGithub
echo "Changlog:"
git log --format="* %s" ${previous}..HEAD
git log --format="* %s" ${previous}..HEAD >> ./app/build/outputs/changelogGithub
echo "Full Changelog:"
CHANGELOG=`\
curl --no-progress-meter --request POST \
--url "https://api.github.com/repos/home-assistant/android/releases/generate-notes" \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $GH_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
--data "{\"tag_name\":\"${{inputs.tag-name}}\",\"target_commitish\":\"master\",\"previous_tag_name\":\"$TAG\"}" \
| jq -r .body
`
echo $CHANGELOG
printf "$CHANGELOG" > ./app/build/outputs/changelogGithub
echo "Beta Changelog"
echo "Beta Changelog:"
git log --format="* %s" HEAD^..HEAD
git log --format="* %s" HEAD^..HEAD > ./app/build/outputs/changelogBeta
4 changes: 4 additions & 0 deletions .github/workflows/onPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}

- uses: ./.github/actions/download-translations
name: Download Translations
Expand Down Expand Up @@ -130,6 +132,8 @@ jobs:

- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}

- uses: ./.github/actions/download-translations
name: Download Translations
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}

- name: Build Debug APK
run: ./gradlew assembleDebug
Expand Down

0 comments on commit 622130b

Please sign in to comment.