File tree 2 files changed +59
-1
lines changed
2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ name: Nightly Build
10
10
on :
11
11
push :
12
12
branches :
13
- - nightly # Just for test purpose only with the nightly repo
13
+ - nightly0 # Just for test purpose only with the nightly repo
14
14
# This schedule will run only from the default branch
15
15
schedule :
16
16
- cron : ' 15 0 * * *' # run at 00:15 AM UTC
Original file line number Diff line number Diff line change
1
+ name : Pre Release
2
+
3
+ on :
4
+ # This schedule will run only from the default branch
5
+ schedule :
6
+ - cron : ' 30 1 * * *' # run at 00:15 AM UTC
7
+ workflow_dispatch :
8
+ inputs :
9
+ force :
10
+ type : boolean
11
+ default : false
12
+ required : false
13
+ description : ' Force Run'
14
+
15
+ defaults :
16
+ run :
17
+ shell : bash
18
+
19
+ jobs :
20
+ pre-release :
21
+ name : Pre Release
22
+ runs-on : ubuntu-latest
23
+ if : github.repository == 'nushell/nightly'
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@v4
27
+ with :
28
+ ref : main
29
+ fetch-depth : 0
30
+ # Configure PAT here: https://github.com/settings/tokens for the push operation in the following steps
31
+ token : ${{ secrets.WORKFLOW_TOKEN }}
32
+
33
+ - name : Setup Nushell
34
+ uses : hustcer/setup-nu@v3
35
+ with :
36
+ version : 0.99.0
37
+
38
+ # Synchronize the main branch of nightly repo with the main branch of Nushell official repo
39
+ - name : Pre Release
40
+ shell : nu {0}
41
+ run : |
42
+ cd $env.GITHUB_WORKSPACE
43
+ git checkout main
44
+ # We can't push if no user name and email are configured
45
+ git config user.name 'hustcer'
46
+ git config user.email 'hustcer@outlook.com'
47
+ git pull origin main
48
+ git remote add src https://github.com/nushell/nushell.git
49
+ git fetch src main
50
+ # All the changes will be overwritten by the upstream main branch
51
+ git reset --hard src/main
52
+ git push origin main -f
53
+ let version = open Cargo.toml | get package.version
54
+ let tag_name = $'($version)-pre'
55
+ if (git ls-remote --tags origin $tag_name | is-empty) {
56
+ git tag -a $tag_name -m $'Pre release from Nushell main branch'
57
+ git push origin --tags
58
+ }
You can’t perform that action at this time.
0 commit comments