Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release notes action for new release model #3748

Merged
merged 9 commits into from
Aug 1, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 41 additions & 8 deletions .github/actions/create-release-notes/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,56 @@
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
gh-token:
description: 'The GitHub token used to get details from the API'
required: true
runs:
using: 'composite'
steps:
- name: Get Previous Release Tag
uses: actions/github-script@v6
id: latest-release-tag
with:
github-token: ${{ inputs.gh-token }}
result-encoding: string
script: |
const { data } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
})
return data.tag_name
- name: Get Generated Release Notes
uses: actions/github-script@v6
id: generate-notes
with:
github-token: ${{ inputs.gh-token }}
result-encoding: string
script: |
const { data } = await github.rest.repos.generateReleaseNotes({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ inputs.tag-name }}',
target_commitish: 'master',
previous_tag_name: '${{ steps.latest-release-tag.outputs.result }}',
})
return data.body
- name: Generate Release Notes
id: version-generator
shell: bash
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:"
echo "${{ steps.latest-release-tag.outputs.result }}"

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="${{ steps.generate-notes.outputs.result }}"
echo -e "$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
10 changes: 10 additions & 0 deletions .github/workflows/onPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
app_build:
name: Github, Firebase, and Sentry Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -54,6 +56,9 @@ jobs:

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

- uses: ./.github/actions/download-translations
name: Download Translations
Expand Down Expand Up @@ -118,6 +123,8 @@ jobs:
runs-on: ubuntu-latest
concurrency:
group: playstore_deploy
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -157,6 +164,9 @@ jobs:

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

- uses: ./.github/actions/download-translations
name: Download Translations
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:

pr_build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -104,6 +106,9 @@ jobs:

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

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