From e9ebd9f42ad3d82e148d5a6a3ef1e20996bf60a8 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 3 Dec 2024 12:12:51 +0100 Subject: [PATCH] Fix CI workflows (#60) (#61) * ci: Update Git user to dedicated CI account Replace a personal GitHub account with the dedicated CI account for Git operations in GitHub Actions. This ensures commits and tags created during CI runs are properly attributed to the CI system. * ci: Switch secret for `DEVELOCITY_ACCESS_KEY` The secret in this repo is named `DEVELOCITY_ACCESS_KEY`. * ci: Fix release-notes.yml Error: Data doesn't contain `nodes` field. --- .github/workflows/gradle.yml | 6 ++-- .github/workflows/release-notes.yml | 50 +++++++---------------------- .github/workflows/release.yml | 4 +-- 3 files changed, 16 insertions(+), 44 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index afe6a6e..0f52544 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,8 +7,8 @@ on: branches: - '[4-9]+.[0-9]+.x' env: - GIT_USER_NAME: grails-build - GIT_USER_EMAIL: grails-build@users.noreply.github.com + GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} + GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} jobs: @@ -48,7 +48,7 @@ jobs: - name: Build Project env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCEESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} run: ./gradlew build - name: Publish Snapshot version to Artifactory (repo.grails.org) diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 2491496..3202c9f 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -1,51 +1,23 @@ -name: Changelog +name: "Release Drafter" on: issues: - types: [closed,reopened] + types: [closed, reopened] push: branches: + - master - '[4-9]+.[0-9]+.x' pull_request: - types: [opened, reopened, synchronize, labeled] + types: [opened, reopened, synchronize] pull_request_target: - types: [opened, reopened, synchronize, labeled] + types: [opened, reopened, synchronize] workflow_dispatch: jobs: - release_notes: + update_release_draft: + permissions: + contents: read # limit to read access runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Check if it has release drafter config file - id: check_release_drafter - run: | - has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false") - echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT - - name: Extract branch name - id: extract_branch - run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - # If it has release drafter: - - uses: release-drafter/release-drafter@v5 - if: steps.check_release_drafter.outputs.has_release_drafter == 'true' + - name: "📝 Update Release Draft" + uses: release-drafter/release-drafter@v6 env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - with: - commitish: ${{ steps.extract_branch.outputs.value }} - # Otherwise: - - name: Export Gradle Properties - if: steps.check_release_drafter.outputs.has_release_drafter == 'false' - uses: micronaut-projects/github-actions/export-gradle-properties@master - - uses: micronaut-projects/github-actions/release-notes@master - if: steps.check_release_drafter.outputs.has_release_drafter == 'false' - id: release_notes - with: - token: ${{ secrets.GH_TOKEN }} - - uses: ncipollo/release-action@v1 - if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true' - with: - allowUpdates: true - commit: ${{ steps.release_notes.outputs.current_branch }} - draft: true - name: "${{ env.title }} ${{ steps.release_notes.outputs.next_version }}" - tag: v${{ steps.release_notes.outputs.next_version }} - bodyFile: CHANGELOG.md - token: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 453805b..e174167 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,8 @@ on: release: types: [published] env: - GIT_USER_NAME: puneetbehl - GIT_USER_EMAIL: behlp@unityfoundation.io + GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} + GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} jobs: release: