diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..bf5b232865db --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,78 @@ +# ------------------------------------------------------------------ # +# # +# SymPy CI script for Github Actions # +# # +# Run on the release branch and builds the release artifacts. # +# # +# ------------------------------------------------------------------ # + +name: release +on: + push: + branches: + - 1.8 + pull_request: + branches: + - 1.8 +env: + release_branch: 1.8 + release_version: 1.8 + +jobs: + + # -------------------- Build artifacts --------------------------- # + + build: + + runs-on: ubuntu-20.04 + steps: + # Check out with full git history for authors check: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Build release files + run: release/ci_release_script.sh ${{ env.release_version }} + + - name: Store release files + uses: actions/upload-artifact@v2 + with: + name: release_files + path: release-${{ env.release_version }} + + # -------------------- Test installation ------------------------- # + + test-install: + needs: [build] + + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy-3.6'] + + name: Python ${{ matrix.python-version }} test install + steps: + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Retrieve release files + uses: actions/download-artifact@v2 + with: + name: release_files + + - name: List files + run: ls -R + + - name: Install wheel + run: pip install sympy-${{ env.release_version }}-py3-none-any.whl + + - name: Run tests after install + run: python -c 'import sympy; sympy.test()' diff --git a/bin/authors_update.py b/bin/authors_update.py index e304ea0cc240..999e6ce09a4b 100755 --- a/bin/authors_update.py +++ b/bin/authors_update.py @@ -18,10 +18,13 @@ if sys.version_info < (3, 6): sys.exit("This script requires Python 3.6 or newer") -from subprocess import run, PIPE +from subprocess import check_output, PIPE from distutils.version import LooseVersion from collections import OrderedDict +def run(cmd): + return check_output(cmd, encoding='utf-8') + def red(text): return "\033[31m%s\033[0m" % text @@ -43,7 +46,8 @@ def green(text): # check git version minimal = '1.8.4.2' -git_ver = run(['git', '--version'], stdout=PIPE, encoding='utf-8').stdout[12:] +git_ver = run(['git', '--version'])[12:] + if LooseVersion(git_ver) < LooseVersion(minimal): print(yellow("Please use a git version >= %s" % minimal)) @@ -61,7 +65,7 @@ def move(l, i1, i2, who): # find who git knows ahout git_command = ["git", "log", "--topo-order", "--reverse", "--format=%aN <%aE>"] -git_people = run(git_command, stdout=PIPE, encoding='utf-8').stdout.strip().split("\n") +git_people = run(git_command).strip().split("\n") # remove duplicates, keeping the original order git_people = list(OrderedDict.fromkeys(git_people)) diff --git a/release/aptinstall.sh b/release/aptinstall.sh index bbe098b90e19..a4ae221df318 100755 --- a/release/aptinstall.sh +++ b/release/aptinstall.sh @@ -2,10 +2,10 @@ set -o errexit -sudo add-apt-repository ppa:deadsnakes/ppa +sudo add-apt-repository -y ppa:deadsnakes/ppa sudo apt update -sudo apt install\ +sudo apt install -y\ antlr4\ libgfortran5\ python3-venv\ @@ -26,7 +26,7 @@ sudo apt install\ gfortran\ # -sudo apt install\ +sudo apt install -y\ python3.6\ python3.6-venv\ python3.7\ @@ -34,10 +34,3 @@ sudo apt install\ python3.9\ python3.9-venv\ # python3.8 is installed by default in 20.04 - -python3 -m venv release/venv_main -source release/venv_main/bin/activate - -pip install -U pip wheel -pip install -r release/requirements.txt -pip install -e . diff --git a/release/ci_release_script.sh b/release/ci_release_script.sh new file mode 100755 index 000000000000..09f4e5cc6b6e --- /dev/null +++ b/release/ci_release_script.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +release/aptinstall.sh + +python3 -m venv release/venv_main +source release/venv_main/bin/activate + +pip install -U pip wheel +pip install -r release/requirements.txt +pip install -e . + +python release/releasecheck.py $1 release-$1 diff --git a/release/compare_tar_against_git.py b/release/compare_tar_against_git.py index c29fb4560e19..d7b77ccd79f5 100755 --- a/release/compare_tar_against_git.py +++ b/release/compare_tar_against_git.py @@ -35,6 +35,7 @@ def main(tarname, gitroot): # Travis and CI '.travis.yml', '.github/workflows/runtests.yml', + '.github/workflows/release.yml', '.ci/durations.json', '.ci/generate_durations_log.sh', '.ci/parse_durations_log.py', @@ -134,6 +135,7 @@ def main(tarname, gitroot): 'release/test_install.py', 'release/sha256.py', 'release/authors.py', + 'release/ci_release_script.sh', # This is just a distribute version of setup.py. Used mainly for setup.py # develop, which we don't care about in the release tarball 'setupegg.py',