From 345c574b42ef7374fba0e15db6de2480d395ddeb Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 6 Oct 2022 05:16:26 -0400 Subject: [PATCH] Fix main build duplication. --- .github/workflows/build-main.yaml | 15 +++++---------- .github/workflows/release-main.yaml | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index bef1e4f8a..1890943c1 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -8,14 +8,6 @@ name: build-main on: repository_dispatch: types: [release-main] - push: - paths-ignore: - - '.github/**' - - 'README.md' - - 'Dockerfile' - - '.dockerignore' - branches: - - main concurrency: group: main @@ -27,7 +19,7 @@ jobs: steps: - uses: hmarr/debug-action@v2 name: debug - - name: get current branch as it may not be default branch; + - name: get current branch as it may not be 'default branch; id: branch run: | branch_arg="${{ github.event.client_payload.branch }}" @@ -43,6 +35,9 @@ jobs: - name: Get date for artifacts id: date run: echo "::set-output name=date::$(date +'%Y%m%d')" + - name: Get short SHA for artifacts + id: sha + run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" - name: Get version id: version run: | @@ -51,7 +46,7 @@ jobs: if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then echo "::set-output name=version::${{ github.event.client_payload.release_tag }}" else - echo "::set-output name=version::${{ steps.date.outputs.date }}" + echo "::set-output name=version::${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" fi - name: Build World run: | diff --git a/.github/workflows/release-main.yaml b/.github/workflows/release-main.yaml index b9eb9b9cc..71611446c 100644 --- a/.github/workflows/release-main.yaml +++ b/.github/workflows/release-main.yaml @@ -6,6 +6,17 @@ name: release-main on: + push: + paths-ignore: + - '.github/**' + - '*.md' + - 'Dockerfile' + - '.dockerignore' + - '.gitignore' + - 'licenses/**' + - 'tools/**' + branches: + - main workflow_dispatch: env: @@ -31,6 +42,16 @@ jobs: run: | echo "::set-output name=full_name::$(git config --get remote.origin.url | sed 's|^.*github.com/||g' | sed 's/.git$//g')" + - name: changes + id: changes + run: | + prevrelcommit="$(git rev-list --tags --max-count=1)" + release_notes="$(git log ${prevrelcommit}..HEAD --pretty=format:"* %h: %s")" + release_notes="${release_notes//'%'/'%25'}" + release_notes="${release_notes//$'\n'/'%0A'}" + release_notes="${release_notes//$'\r'/'%0D'}" + echo "::set-output name=changes::$(echo ${release_notes} | wc -l)" + echo "::set-output name=release_notes::${release_notes}" - name: Get date for artifacts id: date run: echo "::set-output name=date::$(date +'%Y%m%d')" @@ -46,5 +67,6 @@ jobs: { "branch" : "${{ env.BRANCH }}", "release_tag" : "${{steps.date.outputs.date}}", + "release_notes" : ${{toJSON(steps.changes.outputs.release_notes)}} }