From 1fc79cf028a23282d67533250d2f49ef0384979f Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Thu, 3 Oct 2024 18:18:56 +0530 Subject: [PATCH 1/5] Add zenodo badge in the release summary notes --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f97a6514b60..0d71ed1fe3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,36 @@ jobs: python .ci-helpers/get_next_version.py echo "NEW_TAG=$(python .ci-helpers/get_next_version.py)" >> $GITHUB_ENV + - name: Initialize release + uses: softprops/action-gh-release@v1 + with: + name: TARDIS v${{ env.NEW_TAG }} + tag_name: release-${{ env.NEW_TAG }} + body: "This release has been created automatically by the TARDIS continuous delivery pipeline." + draft: true + + - name: Fetch Latest DOI from Zenodo + id: fetch-doi + run: | + CONCEPT_DOI="592480" + # Make the API request for BibTeX format, following redirects + response=$(curl -s -L -H "Accept: application/x-bibtex" "https://zenodo.org/api/records/${CONCEPT_DOI}") + + # Extract the full DOI value correctly + doi=$(echo "$response" | grep -oP 'doi\s*=\s*{([^}]+)}' | grep -oP '\{([^}]+)\}' | sed 's/[{}]//g') + + # Extract the DOI URL directly from the response + url=$(echo "$response" | grep -oP 'url\s*=\s*{([^}]+)}' | grep -oP '\{([^}]+)\}' | sed 's/[{}]//g') + + echo "Extracted DOI: ${doi}" + echo "Extracted URL: ${url}" + # Create DOI badge using the full DOI value + doi_badge="[![DOI Badge](https://img.shields.io/badge/DOI-${doi}-blue)](${doi_url})" + + # Store results in GitHub environment variables + echo "doi_badge=${doi_badge}" >> $GITHUB_ENV + echo "doi_url=${url}" >> $GITHUB_ENV + - name: Generate and process changelog run: | CHANGELOG=$(git cliff --config pyproject.toml --unreleased | sed -n '/^## Changelog/,$p' | grep -vE '^(ERROR|WARN)') @@ -45,16 +75,13 @@ jobs: echo "$CHANGELOG" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - name: Create new release + - name: Update release with changelog and DOI uses: softprops/action-gh-release@v1 with: - token: ${{ secrets.BOT_TOKEN }} - name: TARDIS v${{ env.NEW_TAG}} tag_name: release-${{ env.NEW_TAG }} - prerelease: false body: | This release has been created automatically by the TARDIS continuous delivery pipeline. - + ${{ env.doi_badge }} ${{ env.CHANGELOG }} A complete list of changes for this release is available at [CHANGELOG.md](https://github.com/tardis-sn/tardis/blob/master/CHANGELOG.md). @@ -63,4 +90,4 @@ jobs: conda-linux-64.lock conda-osx-64.lock conda-lock.yml - fail_on_unmatched_files: false + draft: false \ No newline at end of file From 648be69eea0f802a51bd8a3d6a5fa2697f4e5014 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Thu, 3 Oct 2024 18:23:26 +0530 Subject: [PATCH 2/5] Add fail_on_unmatched_files condition to false --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d71ed1fe3a..20efd698de9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,4 +90,5 @@ jobs: conda-linux-64.lock conda-osx-64.lock conda-lock.yml + fail_on_unmatched_files: false draft: false \ No newline at end of file From e01518eac0e435a48e1cccce84a4d233f367639f Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 7 Oct 2024 12:48:48 +0530 Subject: [PATCH 3/5] Fix redirect url --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20efd698de9..f2d826dfb3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: echo "Extracted DOI: ${doi}" echo "Extracted URL: ${url}" # Create DOI badge using the full DOI value - doi_badge="[![DOI Badge](https://img.shields.io/badge/DOI-${doi}-blue)](${doi_url})" + doi_badge="[![DOI Badge](https://img.shields.io/badge/DOI-${doi}-blue)](${url})" # Store results in GitHub environment variables echo "doi_badge=${doi_badge}" >> $GITHUB_ENV From b53dbcf0697af9fba6fdd49fc1d1d8e4b3489fbd Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 7 Oct 2024 18:06:33 +0530 Subject: [PATCH 4/5] add step to sleep for 30 seconds --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2d826dfb3d..2bccb02fd7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,10 @@ jobs: name: TARDIS v${{ env.NEW_TAG }} tag_name: release-${{ env.NEW_TAG }} body: "This release has been created automatically by the TARDIS continuous delivery pipeline." - draft: true + draft: false + + - name: Wait for Zenodo to update the latest release + run: sleep 30 - name: Fetch Latest DOI from Zenodo id: fetch-doi From df94404a028ac4559c940577f494b74cfea65157 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Tue, 8 Oct 2024 09:33:35 +0530 Subject: [PATCH 5/5] Update sleep timer --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bccb02fd7e..79e9f69cd75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: draft: false - name: Wait for Zenodo to update the latest release - run: sleep 30 + run: sleep 120 - name: Fetch Latest DOI from Zenodo id: fetch-doi