diff --git a/.github/actions_scripts/analyse_git_reference.py b/.github/actions_scripts/analyse_git_reference.py index d093bde21f..552d0b879f 100755 --- a/.github/actions_scripts/analyse_git_reference.py +++ b/.github/actions_scripts/analyse_git_reference.py @@ -32,17 +32,6 @@ def get_git_hash(): ]).decode('ascii').strip() -def write_changelog(version): - changelog = subprocess.check_output([ - 'perl', - f'{REPO_PATH}/.github/actions_scripts/getChangelog.pl', - f'{REPO_PATH}/ChangeLog', - version, - ]) - with open(f'{REPO_PATH}/autoLatestChangelog.md', 'wb') as f: - f.write(changelog) - - def get_build_version(jamulus_pro_version): if "dev" in jamulus_pro_version: name = "{}-{}".format(jamulus_pro_version, get_git_hash()) @@ -60,7 +49,7 @@ def set_github_variable(varname, varval): jamulus_pro_version = get_version_from_jamulus_pro() -write_changelog(jamulus_pro_version) +set_github_variable("JAMULUS_PRO_VERSION", jamulus_pro_version) build_version = get_build_version(jamulus_pro_version) fullref = os.environ['GITHUB_REF'] diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 7cd4c3d1e2..2f0fc6d849 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -62,12 +62,14 @@ jobs: publish_to_release: ${{ steps.get-build-vars.outputs.PUBLISH_TO_RELEASE }} upload_url: ${{ steps.create-release.outputs.upload_url }} build_version: ${{ steps.get-build-vars.outputs.BUILD_VERSION }} + env: + release_changelog_path: ./.github_release_changelog.md steps: - name: Checkout code uses: actions/checkout@v2 - - name: Determine release version, type and prerelease variables and generate Changelog + - name: Determine release version, type and prerelease variables run: python3 ${{ github.workspace }}/.github/actions_scripts/analyse_git_reference.py id: get-build-vars @@ -81,6 +83,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Generate release changelog + if: steps.get-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' + run: ./.github/actions_scripts/getChangelog.pl ./ChangeLog ${{ steps.get-build-vars.outputs.JAMULUS_PRO_VERSION }} > ${{ env.release_changelog_path }} + - name: Create Release ${{steps.get-build-vars.outputs.RELEASE_TAG}} ${{steps.get-build-vars.outputs.RELEASE_TITLE}} if: steps.get-build-vars.outputs.PUBLISH_TO_RELEASE == 'true' id: create-release @@ -90,7 +96,7 @@ jobs: with: tag_name: ${{ steps.get-build-vars.outputs.RELEASE_TAG }} release_name: ${{ steps.get-build-vars.outputs.RELEASE_TITLE }} - body_path: autoLatestChangelog.md + body_path: ${{ env.release_changelog_path }} prerelease: ${{ steps.get-build-vars.outputs.IS_PRERELEASE }} draft: false