From 0f0f8d604aee60473717664f6e82dd00783c4814 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 17 Sep 2025 14:28:46 +0800 Subject: [PATCH 01/10] Fix creation of package tarballs --- .github/workflows/{dist.yml => release.yml} | 58 +++++++-------------- 1 file changed, 20 insertions(+), 38 deletions(-) rename .github/workflows/{dist.yml => release.yml} (84%) diff --git a/.github/workflows/dist.yml b/.github/workflows/release.yml similarity index 84% rename from .github/workflows/dist.yml rename to .github/workflows/release.yml index f92d718aa34..165202bacc9 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Prepare source distributions and wheels +name: Release on: push: @@ -12,25 +12,13 @@ on: - '[0-9]+.[0-9]+.[0-9]+.rc[0-9]+' pull_request: paths: - - '.github/workflows/dist.yml' + - '.github/workflows/release.yml' workflow_dispatch: # Allow to run manually jobs: - release_dist: - - # This job first checks whether "configure --enable-download-from-upstream-url" - # (the default since #32390) is needed. - # - # In this way, we check that all necessary package tarballs - # have already been uploaded to the Sage server at the time - # of pushing a release tag. - # - # It also uses "bootstrap -D", thus checking that the "configure" - # tarball has been uploaded to the Sage server at the time - # of pushing a release tag. - + package_tarballs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,45 +26,39 @@ jobs: run: | sudo DEBIAN_FRONTEND=noninteractive apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap _prereq) - - name: make dist (--disable-download-from-upstream-url) - id: make_dist - run: | - ./bootstrap -D && ./configure --disable-download-from-upstream-url && make dist - env: - MAKE: make -j8 - - name: make download (--disable-download-from-upstream-url) - id: make_download - run: | - make -k download DOWNLOAD_PACKAGES=":all: --no-file huge" - env: - MAKE: make -j8 - - name: Reconfigure with --enable-download-from-upstream-url - if: (success() || failure()) && (steps.make_dist.outcome != 'success' || steps.make_download.outcome != 'success') + + - name: Configure run: | + ./bootstrap ./configure - - name: make dist (--enable-download-from-upstream-url) - if: (success() || failure()) && steps.make_dist.outcome != 'success' + + - name: make dist run: | make dist env: MAKE: make -j8 - - name: make download (--enable-download-from-upstream-url) - if: (success() || failure()) && steps.make_download.outcome != 'success' + + - name: make download run: | make -k download DOWNLOAD_PACKAGES=":all: --no-file huge --allow-upstream" env: MAKE: make -j8 + - name: Remove what cannot be distributed - if: success() || failure() run: | rm -f upstream/*do-not-distribute* + + - name: List files + run: | + ls -l dist + ls -l upstream + - uses: actions/upload-artifact@v4 - if: success() || failure() with: path: | dist/*.tar.gz upstream - name: release_dist + name: package_tarballs sdists: @@ -118,7 +100,7 @@ jobs: if: env.CAN_DEPLOY == 'true' release: - needs: [release_dist, sdists] + needs: [package_tarballs, sdists] runs-on: ubuntu-latest if: github.ref_type == 'tag' permissions: @@ -126,7 +108,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: release_dist + name: package_tarballs - uses: actions/download-artifact@v4 with: From 27d0629a3130763a03bc1e3d9e7217b79ff2798b Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 17 Sep 2025 14:29:16 +0800 Subject: [PATCH 02/10] Add creation of automatic announcement in discussions --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 165202bacc9..4d5a7ecba82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,6 +105,7 @@ jobs: if: github.ref_type == 'tag' permissions: contents: write + discussions: write steps: - uses: actions/download-artifact@v4 with: @@ -115,7 +116,7 @@ jobs: name: dist path: dist - - name: Create release assets + - name: Create release uses: softprops/action-gh-release@v2 with: files: | @@ -124,6 +125,7 @@ jobs: token: ${{ secrets.RELEASE_CREATION_TOKEN }} generate_release_notes: true prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} + discussion_category_name: announcements build_wheels: # Temporarily disabled due to build errors From 636d1acc6fd2b738ddd5db6e53088aef6cf63ce7 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 17 Sep 2025 14:56:55 +0800 Subject: [PATCH 03/10] Fix download of sage_numerical_backends_coin --- .github/workflows/release.yml | 6 ++---- build/pkgs/sage_numerical_backends_coin/package-version.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) mode change 120000 => 100644 build/pkgs/sage_numerical_backends_coin/package-version.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d5a7ecba82..b9071bc4ecb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,11 +38,9 @@ jobs: env: MAKE: make -j8 - - name: make download + - name: Download tarballs of all packages run: | - make -k download DOWNLOAD_PACKAGES=":all: --no-file huge --allow-upstream" - env: - MAKE: make -j8 + build/bin/sage-package download :all: --no-file huge --allow-upstream - name: Remove what cannot be distributed run: | diff --git a/build/pkgs/sage_numerical_backends_coin/package-version.txt b/build/pkgs/sage_numerical_backends_coin/package-version.txt deleted file mode 120000 index c4fcb84c1a7..00000000000 --- a/build/pkgs/sage_numerical_backends_coin/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sage_numerical_backends_coin/package-version.txt b/build/pkgs/sage_numerical_backends_coin/package-version.txt new file mode 100644 index 00000000000..1be519cd2ec --- /dev/null +++ b/build/pkgs/sage_numerical_backends_coin/package-version.txt @@ -0,0 +1 @@ +10.4 From a87887843640e50f467ba1db89ce8045b544dffd Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 17 Sep 2025 15:02:26 +0800 Subject: [PATCH 04/10] Fix version of sage-numerical-backends-xyz --- build/pkgs/sage_numerical_backends_cplex/package-version.txt | 2 +- build/pkgs/sage_numerical_backends_gurobi/package-version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 120000 => 100644 build/pkgs/sage_numerical_backends_cplex/package-version.txt mode change 120000 => 100644 build/pkgs/sage_numerical_backends_gurobi/package-version.txt diff --git a/build/pkgs/sage_numerical_backends_cplex/package-version.txt b/build/pkgs/sage_numerical_backends_cplex/package-version.txt deleted file mode 120000 index c4fcb84c1a7..00000000000 --- a/build/pkgs/sage_numerical_backends_cplex/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sage_numerical_backends_cplex/package-version.txt b/build/pkgs/sage_numerical_backends_cplex/package-version.txt new file mode 100644 index 00000000000..1be519cd2ec --- /dev/null +++ b/build/pkgs/sage_numerical_backends_cplex/package-version.txt @@ -0,0 +1 @@ +10.4 diff --git a/build/pkgs/sage_numerical_backends_gurobi/package-version.txt b/build/pkgs/sage_numerical_backends_gurobi/package-version.txt deleted file mode 120000 index c4fcb84c1a7..00000000000 --- a/build/pkgs/sage_numerical_backends_gurobi/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sage_numerical_backends_gurobi/package-version.txt b/build/pkgs/sage_numerical_backends_gurobi/package-version.txt new file mode 100644 index 00000000000..1be519cd2ec --- /dev/null +++ b/build/pkgs/sage_numerical_backends_gurobi/package-version.txt @@ -0,0 +1 @@ +10.4 From a619c0257e53d1e1d8d4327e8a80ce0373da2fc2 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 17 Sep 2025 15:25:09 +0800 Subject: [PATCH 05/10] Remove duplicate sdist --- .github/workflows/release.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9071bc4ecb..69c3047992b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,12 +32,6 @@ jobs: ./bootstrap ./configure - - name: make dist - run: | - make dist - env: - MAKE: make -j8 - - name: Download tarballs of all packages run: | build/bin/sage-package download :all: --no-file huge --allow-upstream @@ -48,14 +42,11 @@ jobs: - name: List files run: | - ls -l dist ls -l upstream - uses: actions/upload-artifact@v4 with: - path: | - dist/*.tar.gz - upstream + path: upstream name: package_tarballs sdists: From b056757f4a14f05e21e7fc75767ac5510d3d664b Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 18 Sep 2025 17:02:17 +0800 Subject: [PATCH 06/10] Fix tarballs upload --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69c3047992b..aa4b065c70b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,7 +91,6 @@ jobs: release: needs: [package_tarballs, sdists] runs-on: ubuntu-latest - if: github.ref_type == 'tag' permissions: contents: write discussions: write @@ -99,19 +98,25 @@ jobs: - uses: actions/download-artifact@v4 with: name: package_tarballs + path: tarballs - uses: actions/download-artifact@v4 with: name: dist path: dist + - name: List files + run: | + ls -l -R dist + ls -l -R tarballs + - name: Create release uses: softprops/action-gh-release@v2 with: files: | dist/* - upstream/* - token: ${{ secrets.RELEASE_CREATION_TOKEN }} + tarballs/* + token: ${{ github.ref_type == 'tag' && secrets.RELEASE_CREATION_TOKEN || 'FAIL' }} generate_release_notes: true prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} discussion_category_name: announcements From db82b1865c18dbde2fccdb7ff7746c136a416a6a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 19 Sep 2025 09:21:39 +0800 Subject: [PATCH 07/10] Remove the need for special secret by incorporating website trigger in release workflow --- .github/workflows/changelog_trigger.yml | 23 ----------------------- .github/workflows/release.yml | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/changelog_trigger.yml diff --git a/.github/workflows/changelog_trigger.yml b/.github/workflows/changelog_trigger.yml deleted file mode 100644 index f3456d9b196..00000000000 --- a/.github/workflows/changelog_trigger.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Trigger Changelog Generation - -on: - release: - types: [published] - -jobs: - trigger-website-repo-workflow: - runs-on: ubuntu-latest - steps: - - name: Trigger Generate Changelog Workflow in website repo - if: "!github.event.release.prerelease" - env: - GITHUB_PAT: ${{ secrets.WEBSITE_ACCESS_TOKEN }} - RELEASE_TAG: ${{ github.event.release.tag_name }} - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GITHUB_PAT" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/sagemath/website/actions/workflows/generate_changelog.yml/dispatches \ - -d '{"ref":"master","inputs":{"release_tag":"'"$RELEASE_TAG"'"}}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa4b065c70b..7b346d4c913 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,6 +94,8 @@ jobs: permissions: contents: write discussions: write + env: + IS_PRERELEASE: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} steps: - uses: actions/download-artifact@v4 with: @@ -116,11 +118,25 @@ jobs: files: | dist/* tarballs/* - token: ${{ github.ref_type == 'tag' && secrets.RELEASE_CREATION_TOKEN || 'FAIL' }} + token: ${{ github.ref_type == 'tag' && github.token || 'FAIL' }} generate_release_notes: true - prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} + prerelease: ${{ env.IS_PRERELEASE }} discussion_category_name: announcements + - name: Trigger Generate Changelog Workflow in website repo + if: github.ref_type == 'tag' && !env.IS_PRERELEASE + env: + GITHUB_PAT: ${{ secrets.WEBSITE_ACCESS_TOKEN }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_PAT" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/sagemath/website/actions/workflows/generate_changelog.yml/dispatches \ + -d '{"ref":"master","inputs":{"release_tag":"'"$RELEASE_TAG"'"}}' + build_wheels: # Temporarily disabled due to build errors if: false From 68298435ba8f1a53ab289bab9d7f513826901ef4 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 19 Sep 2025 09:22:14 +0800 Subject: [PATCH 08/10] Update discussion category name to 'releases' in release workflow --- .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 7b346d4c913..987c83c024b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,7 +121,7 @@ jobs: token: ${{ github.ref_type == 'tag' && github.token || 'FAIL' }} generate_release_notes: true prerelease: ${{ env.IS_PRERELEASE }} - discussion_category_name: announcements + discussion_category_name: releases - name: Trigger Generate Changelog Workflow in website repo if: github.ref_type == 'tag' && !env.IS_PRERELEASE From 07f623736be8ae4f5e06ede8066398ceae1f9fa4 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 19 Sep 2025 10:03:12 +0800 Subject: [PATCH 09/10] Fix changelog workflow trigger condition --- .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 987c83c024b..a4f668204ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,7 +124,7 @@ jobs: discussion_category_name: releases - name: Trigger Generate Changelog Workflow in website repo - if: github.ref_type == 'tag' && !env.IS_PRERELEASE + if: github.ref_type == 'tag' && env.IS_PRERELEASE == 'false' env: GITHUB_PAT: ${{ secrets.WEBSITE_ACCESS_TOKEN }} RELEASE_TAG: ${{ github.ref_name }} From f2b0b0ba99253a87b637749d3f6472eff8910ace Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Fri, 19 Sep 2025 10:03:33 +0800 Subject: [PATCH 10/10] Add job names in release workflow --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4f668204ed..6876ce880b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ on: jobs: package_tarballs: + name: Create tarballs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,7 +51,7 @@ jobs: name: package_tarballs sdists: - + name: Publish source distribution runs-on: ubuntu-latest env: CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' && github.event_name != 'pull_request' }} @@ -89,6 +90,7 @@ jobs: if: env.CAN_DEPLOY == 'true' release: + name: Create GitHub release needs: [package_tarballs, sdists] runs-on: ubuntu-latest permissions: