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/dist.yml b/.github/workflows/release.yml similarity index 80% rename from .github/workflows/dist.yml rename to .github/workflows/release.yml index f92d718aa34..6876ce880b3 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,14 @@ 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: + name: Create tarballs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,48 +27,31 @@ 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' - run: | - make dist - env: - MAKE: make -j8 - - name: make download (--enable-download-from-upstream-url) - if: (success() || failure()) && steps.make_download.outcome != 'success' + + - 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 - if: success() || failure() run: | rm -f upstream/*do-not-distribute* + + - name: List files + run: | + ls -l upstream + - uses: actions/upload-artifact@v4 - if: success() || failure() with: - path: | - dist/*.tar.gz - upstream - name: release_dist + path: upstream + 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' }} @@ -118,30 +90,54 @@ jobs: if: env.CAN_DEPLOY == 'true' release: - needs: [release_dist, sdists] + name: Create GitHub release + needs: [package_tarballs, sdists] runs-on: ubuntu-latest - if: github.ref_type == 'tag' 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: - name: release_dist + name: package_tarballs + path: tarballs - uses: actions/download-artifact@v4 with: name: dist path: dist - - name: Create release assets + - 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' && 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: releases + + - name: Trigger Generate Changelog Workflow in website repo + if: github.ref_type == 'tag' && env.IS_PRERELEASE == 'false' + 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 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 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