@@ -8,23 +8,33 @@ name: F* nightly build
88#
99# The default GITHUB_TOKEN only allows access to the current repo, so it's
1010# not useful.
11+ #
12+ # Nightly builds are scheduled by nightly-schedule.yml, which dispatches
13+ # this workflow for each branch. You can also trigger it manually.
1114
1215on :
13- schedule :
14- - cron : ' 0 0 * * *'
1516 workflow_dispatch :
17+ inputs :
18+ branch :
19+ description : ' Branch to build'
20+ type : string
21+ default : ' master'
1622
1723jobs :
1824 build-all :
1925 uses : ./.github/workflows/build-all.yml
26+ with :
27+ ref : ${{ inputs.branch }}
2028
2129 publish :
2230 runs-on : ubuntu-latest
2331 needs : build-all
2432 steps :
2533 - uses : actions/checkout@master
2634 with :
35+ ref : ${{ inputs.branch }}
2736 fetch-depth : 0 # full clone, so we can push objects
37+ submodules : true
2838
2939 - name : Set up git and some variables
3040 run : |
@@ -33,10 +43,19 @@ jobs:
3343
3444 # We push nightly builds to a different repo (same org)
3545 REPO="${{github.repository}}-nightly"
36- TAG=nightly-$(date -I)
46+
47+ BRANCH="${{ inputs.branch }}"
48+ if [[ "$BRANCH" == "master" ]]; then
49+ TAG=nightly-$(date -I)
50+ else
51+ TAG=nightly-${BRANCH}-$(date -I)
52+ fi
53+
54+ SHA=$(git rev-parse HEAD)
3755
3856 echo "REPO=$REPO" >>$GITHUB_ENV
3957 echo "TAG=$TAG" >>$GITHUB_ENV
58+ echo "SHA=$SHA" >>$GITHUB_ENV
4059
4160 - uses : actions/download-artifact@v8
4261 with :
6180
6281 - name : Create tag
6382 run : |
64- git tag $TAG ${{github.sha}}
83+ git tag $TAG $SHA
6584
6685 - name : Push tag to nightly repo
6786 run : |
7493 run : |
7594 gh release create -R "$REPO" \
7695 --generate-notes \
77- --target ${{ github.sha }} \
96+ --target $SHA \
7897 $TAG artifacts/*
7998 echo "Done!"
8099
0 commit comments