Skip to content

Commit ca31f0b

Browse files
author
Matthias Köppe
authored
Merge branch 'develop' into t/34855/remove_direct_use_of__setup_py_sdist_
2 parents 975f02e + 293dd72 commit ca31f0b

File tree

8 files changed

+102
-40
lines changed

8 files changed

+102
-40
lines changed

.github/workflows/doc-build.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ jobs:
1515
build-docs:
1616
runs-on: ubuntu-latest
1717
container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:dev
18-
env:
19-
CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' }}
2018
steps:
2119
- name: Checkout
2220
uses: actions/checkout@v3
2321

2422
- name: Prepare
2523
run: |
24+
apt-get update && apt-get install -y zip
2625
# Reuse built SAGE_LOCAL contained in the Docker image
2726
./bootstrap
2827
./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv --enable-download-from-upstream-url
@@ -34,43 +33,17 @@ jobs:
3433
SAGE_NUM_THREADS: 2
3534

3635
- name: Copy docs
37-
if: env.CAN_DEPLOY == 'true'
3836
run: |
3937
# For some reason the deploy step below cannot find /sage/...
4038
# So copy everything from there to local folder
4139
# We also need to replace the symlinks because netlify is not following them
4240
mkdir -p ./docs
4341
cp -r -L /sage/local/share/doc/sage/html/en/* ./docs
42+
# Zip everything for increased performance
43+
zip -r docs.zip docs
4444
45-
- name: Deploy to Netlify preview
46-
id: preview-netlify
47-
if: env.CAN_DEPLOY == 'true' && github.ref != 'refs/heads/develop'
48-
uses: netlify/actions/cli@master
45+
- name: Upload docs
46+
uses: actions/upload-artifact@v3
4947
with:
50-
args: deploy --dir=docs --alias="${NETLIFY_ALIAS}"
51-
env:
52-
# Set deployment url to commit hash to easily link from the trac.
53-
# We could also set NETLIFY_ALIAS to the branch name.
54-
# However, netlify currently doesn't support updates to a deployment with the same alias
55-
# https://github.com/netlify/cli/issues/948
56-
# https://github.com/netlify/cli/issues/1984
57-
# Note that even if this feature is implemented, one would also need to first process the branch name
58-
# to workaround the bug https://github.com/netlify/cli/issues/969.
59-
NETLIFY_ALIAS: ${{ github.sha }}
60-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
61-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
62-
63-
- name: Deploy to Netlify production
64-
id: deploy-netlify
65-
if: env.CAN_DEPLOY == 'true' && github.ref == 'refs/heads/develop'
66-
uses: netlify/actions/cli@master
67-
with:
68-
args: deploy --dir=docs --prod
69-
env:
70-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
71-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
72-
73-
- name: Report deployment url
74-
if: env.CAN_DEPLOY == 'true'
75-
run: |
76-
echo "::notice::The documentation has being automatically deployed to Netlify. %0A ✅ Preview: ${{ steps.preview-netlify.outputs.NETLIFY_URL || steps.deploy-netlify.outputs.NETLIFY_URL }}"
48+
name: docs
49+
path: docs.zip

.github/workflows/doc-publish.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Triggers after the documentation build has finished,
2+
# taking the artifact and uploading it to netlify
3+
name: Publish documentation
4+
5+
on:
6+
workflow_run:
7+
workflows: ["Build documentation"]
8+
types:
9+
- completed
10+
11+
permissions:
12+
statuses: write
13+
checks: write
14+
pull-requests: write
15+
16+
jobs:
17+
upload-docs:
18+
runs-on: ubuntu-latest
19+
if: github.event.workflow_run.conclusion == 'success'
20+
steps:
21+
- name: Get information about workflow origin
22+
uses: potiuk/get-workflow-origin@v1_5
23+
id: source-run-info
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
sourceRunId: ${{ github.event.workflow_run.id }}
27+
28+
# Once https://github.com/actions/download-artifact/issues/172 and/or https://github.com/actions/download-artifact/issues/60 is implemented, we can use the official download-artifact action
29+
# For now use the solution from https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
30+
- name: Download docs
31+
uses: actions/[email protected]
32+
with:
33+
script: |
34+
var artifacts = await github.actions.listWorkflowRunArtifacts({
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
run_id: ${{github.event.workflow_run.id }},
38+
});
39+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
40+
return artifact.name == "docs"
41+
})[0];
42+
var download = await github.actions.downloadArtifact({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
artifact_id: matchArtifact.id,
46+
archive_format: 'zip',
47+
});
48+
var fs = require('fs');
49+
fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data));
50+
51+
- name: Extract docs
52+
run: unzip docs.zip -d docs && unzip docs/docs.zip -d docs/docs
53+
54+
- name: Deploy to Netlify
55+
id: deploy-netlify
56+
uses: netlify/actions/cli@master
57+
with:
58+
args: deploy --dir=docs/docs/docs ${NETLIFY_PRODUCTION:+"--prod"} --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
59+
env:
60+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
61+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
62+
NETLIFY_PRODUCTION: ${{ github.ref == 'refs/heads/develop' }}
63+
NETLIFY_MESSAGE: ${{ steps.source-run-info.outputs.pullRequestNumber }}
64+
NETLIFY_ALIAS: deploy-preview-${{ steps.source-run-info.outputs.pullRequestNumber }}
65+
66+
# Add deployment as status check, PR comment and annotation
67+
# we could use the nwtgck/actions-netlify action for that, except for that it is not (yet) working in workflow_run context: https://github.com/nwtgck/actions-netlify/issues/545
68+
- name: Add/Update deployment status PR comment
69+
uses: marocchino/sticky-pull-request-comment@v2
70+
with:
71+
number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
72+
header: preview-comment
73+
recreate: true
74+
message: |
75+
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}) is ready! :tada:
76+
Built with commit: ${{ steps.source-run-info.outputs.sourceHeadSha }}
77+
78+
- name: Update deployment status PR check
79+
uses: myrotvorets/[email protected]
80+
if: ${{ always() }}
81+
env:
82+
DEPLOY_SUCCESS: Successfully deployed preview.
83+
DEPLOY_FAILURE: Failed to deploy preview.
84+
with:
85+
token: ${{ secrets.GITHUB_TOKEN }}
86+
status: ${{ job.status == 'success' && 'success' || 'failure' }}
87+
sha: ${{ github.event.workflow_run.head_sha }}
88+
context: Deploy Documentation
89+
targetUrl: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}
90+
description: ${{ job.status == 'success' && env.DEPLOY_SUCCESS || env.DEPLOY_FAILURE }}
91+
92+
- name: Report deployment url
93+
run: |
94+
echo "::notice::The documentation has being automatically deployed to Netlify. %0A ✅ Preview: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
95+

src/sage/combinat/key_polynomial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,4 +863,3 @@ def sorting_word(alpha):
863863
w.append(j+1)
864864
L[j], L[j + 1] = L[j + 1], L[j]
865865
return reversed(w), L
866-

src/sage/combinat/schubert_polynomial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,4 +499,3 @@ def product_on_basis(self, left, right):
499499
X[4, 2, 1, 3]
500500
"""
501501
return symmetrica.mult_schubert_schubert(left, right)
502-

src/sage/groups/cactus_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,4 +997,3 @@ def gens(self):
997997
continue
998998
gens.append(val)
999999
return tuple([self(g) for g in gens])
1000-

src/sage/groups/finitely_presented_named.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,4 +595,3 @@ def CactusPresentation(n):
595595
elt = gens[i] * gens[j] * ~gens[K.index(y)] * ~gens[K.index(x)]
596596
rls.append(elt)
597597
return FinitelyPresentedGroup(F, tuple(rls))
598-

src/sage/groups/kernel_subgroup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,3 @@ def __invert__(self):
223223
s[1,2]*s[2,3]*s[1,2]*s[1,3]
224224
"""
225225
return type(self)(self.parent(), ~self.value)
226-

src/sage/groups/misc_gps/misc_groups_catalog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@
2525
from sage.combinat.root_system.reflection_group_real import ReflectionGroup
2626
from sage.groups.cactus_group import CactusGroup as Cactus
2727
from sage.groups.cactus_group import PureCactusGroup as PureCactus
28-

0 commit comments

Comments
 (0)