Skip to content

Commit

Permalink
Enable nightly builds with fixed URL
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 21, 2023
1 parent d284d81 commit 0f03f2e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow takes care of creating nightly release archives for the
# GAP distribution. It works by tagging the latest master branch as "nightly"
# which then triggers the regular release workflow. Doing it this way ensures
# that everything is as close as possible to a regular release.
name: "Nightly releases"

on:
workflow_dispatch:
schedule:
# Every day at 3:33 AM UTC
- cron: '39 3 * * *'

jobs:
nightly:
runs-on: ubuntu-latest
steps:
#- uses: dev-drprasad/delete-tag-and-release@v1.0
# with:
# tag_name: nightly
# github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "nightly"
tag_exists_error: false
#force_push_tag: true
message: "Nightly build"


8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:
workflow_dispatch:
pull_request:
push:
tags: v[1-9]+.[0-9]+.[0-9]+
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.
branches:
- master
- stable-*
Expand Down Expand Up @@ -121,7 +123,7 @@ jobs:
retention-days: 7

- name: "Make GitHub release"
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/tags/nightly' }}
run: python -u ./dev/releases/make_github_release.py ${GITHUB_REF#refs/tags/} tmp/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -203,7 +205,7 @@ jobs:

- name: "Upload the installer to tag"
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/tags/nightly' }}
with:
files: |
gap-windows/Output/gap-${{ env.GAP_VERSION }}-x86_64.exe
Expand Down
8 changes: 6 additions & 2 deletions dev/releases/make_github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

TAG_NAME = sys.argv[1]
PATH_TO_RELEASE = sys.argv[2]
if TAG_NAME.startswith("v4")
VERSION = TAG_NAME[1:] # strip 'v' prefix
else:
VERSION = TAG_NAME

utils.verify_git_clean()
utils.verify_is_possible_gap_release_tag(TAG_NAME)
Expand All @@ -43,7 +47,7 @@
utils.error(f"Github release with tag '{TAG_NAME}' already exists!")

# Create release
RELEASE_NOTE = f"For an overview of changes in GAP {TAG_NAME[1:]} see the " \
RELEASE_NOTE = f"For an overview of changes in GAP {VERSION} see the " \
+ f"[CHANGES.md](https://github.com/gap-system/gap/blob/{TAG_NAME}/CHANGES.md) file."
utils.notice(f"Creating release {TAG_NAME}")
RELEASE = utils.CURRENT_REPO.create_git_release(TAG_NAME, TAG_NAME,
Expand All @@ -60,7 +64,7 @@
print(filename)

# Now check that TAG_NAME and the created archives belong together
main_archive_name = "gap-" + TAG_NAME[1:] + ".tar.gz"
main_archive_name = "gap-" + VERSION + ".tar.gz"
if not main_archive_name in manifest:
utils.error(f"Expected to find {main_archive_name} in MANIFEST, but did not!")

Expand Down

0 comments on commit 0f03f2e

Please sign in to comment.