1
- # This workflow is for nightly releases, automatically triggered at midnight US Eastern
1
+ # A release from main. Automatically triggered at midnight US Eastern.
2
+
2
3
name : Nightly Build
3
4
4
5
on :
12
13
required : false
13
14
default : ' main'
14
15
16
+
15
17
concurrency :
16
18
group : ${{ github.workflow }}-${{ github.ref }}
17
19
cancel-in-progress : true
@@ -22,25 +24,30 @@ jobs:
22
24
runs-on : ubuntu-latest
23
25
outputs :
24
26
version : ${{ steps.set-version.outputs.version }}
27
+ commit_sha : ${{ steps.get-commit.outputs.commit_sha }}
25
28
steps :
26
29
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
27
30
with :
28
- ref : ${{ github.event.inputs.branch || github.ref }}
31
+ ref : main # Ensure we're building from latest main
32
+ fetch-depth : 0
33
+
34
+ - name : Get commit info
35
+ id : get-commit
36
+ run : |
37
+ echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
38
+ echo "Building from commit: $(git rev-parse HEAD)"
39
+ echo "Latest commit: $(git log -1 --oneline)"
29
40
30
41
- name : Generate a nightly version
31
42
id : set-version
32
43
run : |
44
+ # Extract the version from Cargo.toml and add nightly tag with date and short commit
33
45
VERSION=$(grep '^version\s*=' Cargo.toml | head -n 1 | cut -d\" -f2)
34
46
DATE=$(date -u +%Y%m%d)
35
- VERSION="${VERSION}-nightly.${DATE}"
36
-
37
- # validate
38
- if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}$ ]]; then
39
- echo "Error: Invalid version format: $VERSION"
40
- exit 1
41
- fi
42
-
47
+ SHORT_SHA=$(git rev-parse --short HEAD)
48
+ VERSION="${VERSION}-nightly.${DATE}.${SHORT_SHA}"
43
49
echo "version=$VERSION" >> $GITHUB_OUTPUT
50
+ echo "Generated version: $VERSION"
44
51
45
52
build-cli :
46
53
needs : [prepare-version]
67
74
contents : read
68
75
with :
69
76
version : ${{ needs.prepare-version.outputs.version }}
70
- signing : false
77
+ signing : true
78
+ secrets :
79
+ OSX_CODESIGN_ROLE : ${{ secrets.OSX_CODESIGN_ROLE }}
71
80
72
81
bundle-desktop-linux :
73
82
needs : [prepare-version]
@@ -80,32 +89,19 @@ jobs:
80
89
uses : ./.github/workflows/bundle-desktop-windows.yml
81
90
with :
82
91
version : ${{ needs.prepare-version.outputs.version }}
83
- signing : false
92
+ signing : true
93
+ secrets :
94
+ WINDOW_SIGNING_ROLE : ${{ secrets.WINDOW_SIGNING_ROLE }}
95
+ WINDOW_SIGNING_ROLE_TAG : ${{ secrets.WINDOW_SIGNING_ROLE_TAG }}
84
96
85
97
release :
86
98
name : Release
87
99
runs-on : ubuntu-latest
88
100
needs : [prepare-version, build-cli, install-script, bundle-desktop, bundle-desktop-linux, bundle-desktop-windows]
89
101
permissions :
90
102
contents : write
91
- actions : read
92
103
steps :
93
104
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
94
- with :
95
- ref : ${{ github.event.inputs.branch || github.ref }}
96
- fetch-depth : 0 # Fetch all history for proper tagging
97
-
98
- - name : Create tag
99
- run : |
100
- TAG="${{ needs.prepare-version.outputs.version }}"
101
-
102
- echo "Creating tag: $TAG"
103
- git config user.name "github-actions[bot]"
104
- git config user.email "github-actions[bot]@users.noreply.github.com"
105
-
106
- git tag -a "$TAG" -m "Nightly release $TAG - SHA: ${{ github.sha }} - Run: ${{ github.run_number }}"
107
- git push origin "$TAG"
108
- echo "Tag $TAG created successfully"
109
105
110
106
- name : Download all artifacts
111
107
uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # pin@v4
@@ -129,4 +125,3 @@ jobs:
129
125
omitBody : true
130
126
prerelease : true
131
127
makeLatest : false
132
- omitPrereleaseDuringUpdate : true
0 commit comments