-
Notifications
You must be signed in to change notification settings - Fork 236
65 lines (53 loc) · 2.02 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: F* nightly build
# For this to work, there must a repo called FStar-nightly
# in the same org as FStar, and a DZOMO_GITHUB_TOKEN secret configured
# in the FStar repo that has write access to FStar-nightly (i.e. 'Contents'
# permission), *AND* also workflow access (or you'll get "Refusing to
# allow a Personal Access Token to create or update workflow").
#
# The default GITHUB_TOKEN only allows access to the current repo, so it's
# not useful.
on:
push:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build-all:
uses: ./.github/workflows/build-all.yml
publish:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # full clone, so we can push objects
- name: Set up git
run: |
git config --global user.name "Dzomo, the Everest Yak"
git config --global user.email "[email protected]"
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
# ^ Download all artifacts into the same dir.
# Each of them is a single file, so no clashes happen.
- name: Publish artifacts in nightly tag
run: |
git config --unset-all http.https://github.com/.extraheader
# ^ https://stackoverflow.com/questions/64374179/how-to-push-to-another-repository-in-github-actions
# We push nightly builds to a different repo (same org)
REPO="${{github.repository}}-nightly"
TAG=nightly-$(date -I)
# Create tag
git tag $TAG ${{github.sha}}
# Add new remote and push tag
git remote add nightly-repo https://${{secrets.DZOMO_GITHUB_TOKEN}}@github.com/$REPO
git push nightly-repo $TAG
# Create release
gh release create -R "$REPO" \
--generate-notes \
--target ${{ github.sha }} \
$TAG artifacts/*
env:
GH_TOKEN: ${{ secrets.DZOMO_GITHUB_TOKEN }}