From fabad5e452713eaf98896ca1bda838e375c4b3b9 Mon Sep 17 00:00:00 2001 From: K3rnelPan1c <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 16 Apr 2022 14:30:19 +0200 Subject: [PATCH 1/2] deprecate bump version in favour of old behaviour of changelog the auto bump does not work for protected branches, which some plugins have configured --- .github/workflows/bump-version.yaml | 2 ++ .github/workflows/changelog.yaml | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 315e41b..7d2dfd4 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -1,3 +1,5 @@ +# DEPRECATED: Please use / rely on the changelog workflow as that works with protected branches + on: workflow_call: inputs: diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 253a422..40a1098 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -26,7 +26,7 @@ jobs: steps: # Drafts your next Release notes as Pull Requests are merged into "master" - name: Update Draft - uses: release-drafter/release-drafter@v5.16.1 + uses: release-drafter/release-drafter@v5.19.0 id: draft env: GITHUB_TOKEN: ${{ secrets.token }} @@ -59,7 +59,16 @@ jobs: - name: Update build.yaml if: ${{ env.HAS_CHANGES == 'true' }} run: |- - yq eval '.targetAbi = env(ABI_VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml + if [[ -f Directory.Build.props ]]; then + # https://stackoverflow.com/a/57510475 + # https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022 + sed -i Directory.Build.props \ + -e "s;.*;${VERSION}.0.0.0;" \ + -e "s;.*;${VERSION}.0.0.0;" \ + -e "s;.*;${VERSION}.0.0.0;" + fi + + yq eval '.version = env(VERSION) | .targetAbi = env(ABI_VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml - name: Commit Changes if: ${{ env.HAS_CHANGES == 'true' }} From 5485313fbb76c90316c54cc16f4ca7089bfa5c63 Mon Sep 17 00:00:00 2001 From: K3rnelPan1c <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 16 Apr 2022 14:33:48 +0200 Subject: [PATCH 2/2] remove obsolete yq setup step yq is already included in new GitHub Action virtual-environments in a recent enough version --- .github/workflows/bump-version.yaml | 5 ----- .github/workflows/changelog.yaml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 7d2dfd4..306f497 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -38,11 +38,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2.4.0 - - name: Setup YQ - uses: chrisdickinson/setup-yq@v1.0.1 - with: - yq-version: v4.16.2 - - name: Read current version run: |- echo "CURRENT_VERSION=$(yq eval '.version' build.yaml)" diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 40a1098..a813e17 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -31,11 +31,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.token }} - - name: Setup YQ - uses: chrisdickinson/setup-yq@v1.0.1 - with: - yq-version: v4.16.2 - - name: Set-up Environment run: |- TAG="${{ steps.draft.outputs.tag_name }}"