Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release and documentation CI #2174

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ on:
- '.github/workflows/docs.yml'

jobs:
##############################################################################
#############################################################################
# build documentation
##############################################################################
#############################################################################
build-doc:
name: Push documentation to website
if: github.repository == 'flintlib/flint'
Expand All @@ -29,7 +29,7 @@ jobs:

- name: "Setup"
run: |
sudo apt-get install -y python3-sphinx
sudo apt-get install -y python3-sphinx texlive-full
sphinx-build --version

- name: "Build documentation"
Expand All @@ -38,12 +38,9 @@ jobs:
make html SPHINXOPTS="-W -j auto"

- name: "Build PDF documentation"
uses: dante-ev/latex-action@latest
with:
root_file:
compiler:
args:
entrypoint: doc/entrypoint.sh
run: |
cd doc
make latexpdf SPHINXOPTS="-W -j auto"

- name: "Create a tarball of the documentation"
run: |
Expand Down
46 changes: 21 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:
default: nightly
push:
tags:
- v[1-9]+.[0-9]+.[0-9] # allow v1.2.3
- v[1-9]+.[0-9]+.[0-9]-* # allow v1.2.3-beta3 etc.
- v[1-9]+.[0-9]+.[0-9] # allow v1.2.3
- v[1-9]+.[0-9]+.[0-9]-[a-z0-9]+ # allow v1.2.3-beta3 etc.
schedule:
# Every day at 3:33 AM UTC
- cron: '33 3 * * *'
Expand All @@ -31,7 +31,7 @@ concurrency:

jobs:
version_and_tag:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.get-version.outputs.version }}
tag_name: ${{ steps.get-tag_name.outputs.tag_name }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:


make-archive:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: version_and_tag
env:
FLINT_VERSION: ${{ needs.version_and_tag.outputs.version }}
Expand All @@ -97,7 +97,7 @@ jobs:

test-archive:
needs: [version_and_tag, make-archive]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
FLINT_VERSION: ${{ needs.version_and_tag.outputs.version }}
TAG_NAME: ${{ needs.version_and_tag.outputs.tag_name }}
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:

upload-archive:
needs: [version_and_tag, make-archive, test-archive]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
FLINT_VERSION: ${{ needs.version_and_tag.outputs.version }}
TAG_NAME: ${{ needs.version_and_tag.outputs.tag_name }}
Expand All @@ -170,22 +170,25 @@ jobs:
# figure out SUBJECT and PRERELEASE
- if: env.TAG_NAME == 'nightly'
run: |
(echo 'SUBJECT=FLINT nightly release';
echo 'PRERELEASE=--prerelease --draft') >> $GITHUB_ENV
(echo "SUBJECT=\"FLINT nightly release\"";
echo "PRERELEASE=\"--prerelease --draft\"") >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true


- if: env.TAG_NAME != 'nightly'
run: |
(echo 'SUBJECT=FLINT release';
echo 'PRERELEASE=') >> $GITHUB_ENV
(echo "SUBJECT=\"FLINT v${FLINT_VERSION}\"";
echo "PRERELEASE=") >> $GITHUB_ENV
gh release delete stable --yes || true
git push origin :stable || true

- name: Generate checksums
- name: Generate release message
run: |
printf '## SHA256 Checksums\n```\n' > $RUNNER_TEMP/notes.md
# Print tag message
git for-each-ref refs/tags/v${FLINT_VERSION} --format='%(contents)' > $RUNNER_TEMP/notes.md
# Generate checksums
printf '## SHA256 Checksums\n```\n' >> $RUNNER_TEMP/notes.md
for ext in tar.gz tar.xz zip; do
fn=flint-${FLINT_VERSION}.$ext
# `sha256sum` outputs <sha> <path>,
Expand All @@ -207,19 +210,12 @@ jobs:
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA flint-${FLINT_VERSION}.{tar.gz,tar.xz,zip}

- if: env.TAG_NAME != 'nightly'
name: "Setup for PDF documentation"
name: "Build PDF documentation"
run: |
sudo apt-get install -y python3-sphinx
sudo apt-get install -y python3-sphinx texlive-full
sphinx-build --version

- if: env.TAG_NAME != 'nightly'
name: "Build PDF documentation"
uses: dante-ev/latex-action@latest
with:
root_file:
compiler:
args:
entrypoint: doc/entrypoint.sh
cd doc/
make latexpdf SPHINXOPTS="-W -j auto"

- if: env.TAG_NAME != 'nightly'
name: "Setup SSH key"
Expand All @@ -236,7 +232,7 @@ jobs:
mv doc/build/latex/flint.pdf flint-${FLINT_VERSION}.pdf
for ext in pdf tar.gz zip; do
scp flint-${FLINT_VERSION}.$ext [email protected]:~/apps/flintlib_org/download/
# Rebuild the website
ssh -t [email protected] 'cd ~/flintwebpage && python3 downloads.py ~/apps/flintlib_org && python3 build.py ~/apps/flintlib_org'
# Rebuild the website and append version-date tuple to HISTORY
ssh -t [email protected] 'cd ~/flintwebpage && date +'"'"'%Y-%m-%d'"'"' >> HISTORY && python3 downloads.py ~/apps/flintlib_org && python3 build.py ~/apps/flintlib_org'

# TODO: we could / should perhaps also test `make install` ?