From c51eb043ac01b016245f190d88509fa1547f10f5 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:50:05 +0800 Subject: [PATCH 1/2] Generate unique tag name based on merge commit time --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 492c6305232..92506a21ced 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,9 @@ jobs: java-package: jdk+fx - name: Create JAR file run: ./gradlew shadowJar + - name: Generate tag name from time + id: time + run: echo ::set-output name=NOW::$(echo ${{ github.event.repository.updated_at}} | sed -e 's/-//g' -e 's/T/-/g' -e 's/.\{4\}$/Z/' -e 's/://g') - name: Create release on GitHub id: create_release # We need the id to refer to it in the next step uses: actions/create-release@v1 From 4fffd9ab3f99736a138e782aff28b5a4a616c1c5 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:50:38 +0800 Subject: [PATCH 2/2] Use unique tag names for releases Fixes errors that occurred previously --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92506a21ced..71d8eecbccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,9 +34,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: Auto-created release from ${{ github.ref }} + tag_name: ${{ steps.time.outputs.NOW }} + release_name: Auto-release ${{ github.event.repository.updated_at}} + body: 'Auto-created release from branch "${{ github.ref_name }}"' - name: Upload JAR file to GitHub releases uses: actions/upload-release-asset@v1 env: