Skip to content
Open
23 changes: 0 additions & 23 deletions .github/workflows/changelog_trigger.yml

This file was deleted.

104 changes: 50 additions & 54 deletions .github/workflows/dist.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare source distributions and wheels
name: Release

on:
push:
Expand All @@ -12,74 +12,46 @@ 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
- name: Install bootstrap prerequisites
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' }}
Expand Down Expand Up @@ -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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am waiting for a reply.

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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.4

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.4

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.4
Loading