mirror of
https://github.com/home-assistant/android
synced 2024-07-09 04:15:51 +00:00
Update release notes action for new release model (#3748)
* Update release notes action for new release model * Include newlines * Switch to actions/github-script * Fix token input * Named arguments, get owner/repo from context * Return specific data and update vars * Last fixes, hopefully * Set result encoding to string * Prevent echo from printing directory contents
This commit is contained in:
parent
91fdba5706
commit
bf0479a46f
49
.github/actions/create-release-notes/action.yml
vendored
49
.github/actions/create-release-notes/action.yml
vendored
|
@ -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
.github/workflows/onPush.yml
vendored
10
.github/workflows/onPush.yml
vendored
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -118,6 +123,8 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: playstore_deploy
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -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
|
||||
|
|
5
.github/workflows/pr.yml
vendored
5
.github/workflows/pr.yml
vendored
|
@ -63,6 +63,8 @@ jobs:
|
|||
|
||||
pr_build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user