Skip to content

Commit 2beee03

Browse files
committed
wip(build): refactor nightly workflow to just reuse the build workflow
1 parent 37475a0 commit 2beee03

File tree

5 files changed

+75
-171
lines changed

5 files changed

+75
-171
lines changed

.github/workflows/_build.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,6 @@ on:
4343
type: string
4444
required: false
4545
default: "prerelease"
46-
secrets:
47-
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64:
48-
description: Base64 encoded Apple Developer Certificate
49-
required: true
50-
APPLE_DEVELOPER_CERTIFICATE_PASSWORD:
51-
description: Password for Apple Developer Certificate
52-
required: true
53-
KEYCHAIN_PASSWORD:
54-
description: Password to use for temporary local keychain on runner
55-
required: true
56-
AC_USERNAME:
57-
description: Apple Connect Username
58-
required: true
59-
AC_PASSWORD:
60-
description: Apple Connect Password
61-
required: true
62-
AC_PROVIDER:
63-
description: Apple Connect Provider
64-
required: true
65-
AC_SIGN_IDENTITY:
66-
description: Apple Connect Signing Identify
67-
required: true
6846
outputs:
6947
package_created:
7048
description: "Whether or not a package was created"

.github/workflows/_prepare.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ on:
55
inputs:
66
builder_ref:
77
description: Git ref to checkout of build-emacs-for-macos
8-
required: false
8+
required: true
99
type: string
10-
default: "v0.6.52"
1110
outputs:
1211
builder_sha:
1312
description: Git SHA of build-emacs-for-macos at builder_ref

.github/workflows/_update-casks.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ on:
1111
type: string
1212
required: false
1313
default: "ubuntu-latest"
14-
secrets:
15-
TAP_REPO_TOKEN:
16-
description: Personal Access Token for Homebrew Tap repo
17-
required: true
1814

1915
jobs:
2016
emacs-builds:

.github/workflows/build.yml

Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,74 @@ on:
3636
required: false
3737
default: true
3838
type: boolean
39+
workflow_call:
40+
inputs:
41+
git_ref:
42+
description: Emacs git ref to build
43+
required: true
44+
type: string
45+
git_sha:
46+
description: Override Emacs git commit SHA to build
47+
required: false
48+
type: string
49+
builder_ref:
50+
description: "Git ref to checkout of build-emacs-for-macos"
51+
required: false
52+
default: "v0.6.52"
53+
type: string
54+
builder_args:
55+
description: Custom arguments passed to build script
56+
required: false
57+
default: ""
58+
type: string
59+
test_build_name:
60+
description: "Test build name"
61+
required: false
62+
default: ""
63+
type: string
64+
test_release_type:
65+
description: "prerelease or draft"
66+
required: false
67+
default: ""
68+
type: string
69+
x86_64:
70+
description: "Build x86_64 version of Emacs"
71+
required: false
72+
default: true
73+
type: boolean
74+
arm64:
75+
description: "Build arm64 version of Emacs"
76+
required: false
77+
default: true
78+
type: boolean
3979

4080
jobs:
4181
prepare:
4282
name: Prepare
4383
uses: ./.github/workflows/_prepare.yml
4484
with:
45-
builder_ref: ${{ github.event.inputs.builder_ref }}
85+
builder_ref: ${{ inputs.builder_ref }}
4686

4787
# ----------------------------------------------------------------------------
4888
# Build x86_64 version of Emacs
4989
# ----------------------------------------------------------------------------
5090

5191
build_x86_64:
5292
name: Build (x86_64)
53-
if: github.event.inputs.x86_64 == 'true'
93+
if: inputs.x86_64 == 'true'
5494
uses: ./.github/workflows/_build.yml
5595
needs: [prepare]
5696
with:
5797
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
5898
os: "macos-13"
5999
build_os: "macos-13" # Only macos-13 and earlier are x86_64.
60100
artifact_prefix: "x86_64-"
61-
git_ref: ${{ github.event.inputs.git_ref }}
62-
git_sha: ${{ github.event.inputs.git_sha }}
63-
build_args: ${{ github.event.inputs.builder_args }}
64-
test_build_name: ${{ github.event.inputs.test_build_name }}
65-
test_release_type: ${{ github.event.inputs.test_release_type }}
66-
secrets:
67-
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
68-
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
69-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
70-
AC_USERNAME: ${{ secrets.AC_USERNAME }}
71-
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
72-
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
73-
AC_SIGN_IDENTITY: ${{ secrets.AC_SIGN_IDENTITY }}
101+
git_ref: ${{ inputs.git_ref }}
102+
git_sha: ${{ inputs.git_sha }}
103+
build_args: ${{ inputs.builder_args }}
104+
test_build_name: ${{ inputs.test_build_name }}
105+
test_release_type: ${{ inputs.test_release_type }}
106+
secrets: inherit
74107

75108
release_x86_64:
76109
name: Release (x86_64)
@@ -96,27 +129,20 @@ jobs:
96129

97130
build_arm64:
98131
name: Build (arm64)
99-
if: github.event.inputs.arm64 == 'true'
132+
if: inputs.arm64 == 'true'
100133
uses: ./.github/workflows/_build.yml
101134
needs: [prepare]
102135
with:
103136
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
104137
os: "macos-14"
105138
build_os: "macos-14" # Only macos-14 and later are ARM64.
106139
artifact_prefix: "arm64-"
107-
git_ref: ${{ github.event.inputs.git_ref }}
108-
git_sha: ${{ github.event.inputs.git_sha }}
109-
build_args: ${{ github.event.inputs.builder_args }}
110-
test_build_name: ${{ github.event.inputs.test_build_name }}
111-
test_release_type: ${{ github.event.inputs.test_release_type }}
112-
secrets:
113-
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
114-
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
115-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
116-
AC_USERNAME: ${{ secrets.AC_USERNAME }}
117-
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
118-
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
119-
AC_SIGN_IDENTITY: ${{ secrets.AC_SIGN_IDENTITY }}
140+
git_ref: ${{ inputs.git_ref }}
141+
git_sha: ${{ inputs.git_sha }}
142+
build_args: ${{ inputs.builder_args }}
143+
test_build_name: ${{ inputs.test_build_name }}
144+
test_release_type: ${{ inputs.test_release_type }}
145+
secrets: inherit
120146

121147
release_arm64:
122148
name: Release (arm64)
@@ -149,8 +175,7 @@ jobs:
149175
needs: [release_x86_64, release_arm64]
150176
if: >-
151177
always() &&
152-
github.event.inputs.test_build_name == '' &&
178+
inputs.test_build_name == '' &&
153179
contains(needs.*.result, 'success') &&
154180
!contains(needs.*.result, 'failure')
155-
secrets:
156-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
181+
secrets: inherit

.github/workflows/nightly-master.yml

Lines changed: 17 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,126 +2,32 @@
22
name: Nightly (master)
33
on:
44
schedule:
5-
- cron: "0 23 1 * *"
6-
- cron: "0 23 2-31 * *"
5+
- cron: "0 23 * * *"
76
workflow_dispatch:
87
inputs:
98
git_sha:
109
description: Override Emacs git commit SHA to build
1110
required: false
11+
x86_64:
12+
description: "Build x86_64 version of Emacs"
13+
required: false
14+
default: true
15+
type: boolean
1216
arm64:
13-
description: "Build arm64 version of Emacs?"
17+
description: "Build arm64 version of Emacs"
1418
required: false
15-
default: false
19+
default: true
1620
type: boolean
1721

1822
jobs:
19-
prepare:
20-
name: Prepare
21-
uses: ./.github/workflows/_prepare.yml
22-
secrets:
23-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
24-
25-
# ----------------------------------------------------------------------------
26-
# Build x86_64 version of Emacs
27-
# ----------------------------------------------------------------------------
28-
29-
build_x86_64:
30-
name: Build (x86_64)
31-
uses: ./.github/workflows/_build.yml
32-
needs: [prepare]
33-
with:
34-
build_os: "macos-13"
35-
artifact_prefix: "x86_64-"
36-
git_ref: "master"
37-
git_sha: ${{ github.event.inputs.git_sha }}
38-
secrets:
39-
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
40-
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
41-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
42-
AC_USERNAME: ${{ secrets.AC_USERNAME }}
43-
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
44-
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
45-
AC_SIGN_IDENTITY: ${{ secrets.AC_SIGN_IDENTITY }}
46-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
47-
48-
release_x86_64:
49-
name: Release (x86_64)
50-
uses: ./.github/workflows/_release.yml
51-
# Depend on both build_x86_64 and build_arm64, but only run if build_x86_64
52-
# was successful and a package was created. This ensure wait for all builds
53-
# to complete before running any release jobs.
54-
needs: [build_x86_64, build_arm64]
55-
if: |
56-
always() &&
57-
needs.build_x86_64.result == 'success' &&
58-
needs.build_x86_64.outputs.package_created &&
59-
needs.build_arm64.result != 'failure'
23+
build:
24+
name: Build
25+
uses: ./.github/workflows/build.yml
6026
with:
61-
plan_artifact: x86_64-build-plan
62-
dmg_artifact: x86_64-dmg
63-
secrets:
64-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
65-
66-
# ----------------------------------------------------------------------------
67-
# Build arm64 version of Emacs
68-
# ----------------------------------------------------------------------------
69-
70-
build_arm64:
71-
name: Build (arm64)
72-
if: >-
73-
github.event.inputs.arm64 == 'true' ||
74-
github.event.schedule == '0 23 1 * *'
75-
uses: ./.github/workflows/_build.yml
76-
needs: [prepare]
77-
with:
78-
build_os: "macos-13-xlarge" # Only macos-13-xlarge has arm64 support.
79-
artifact_prefix: "arm64-"
8027
git_ref: "master"
81-
git_sha: ${{ github.event.inputs.git_sha }}
82-
secrets:
83-
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
84-
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
85-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
86-
AC_USERNAME: ${{ secrets.AC_USERNAME }}
87-
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
88-
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
89-
AC_SIGN_IDENTITY: ${{ secrets.AC_SIGN_IDENTITY }}
90-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
91-
92-
release_arm64:
93-
name: Release (arm64)
94-
uses: ./.github/workflows/_release.yml
95-
# Depend on both build_arm64 and build_x86_64, but only run if build_arm64
96-
# was successful and a package was created. This ensure wait for all builds
97-
# to complete before running any release jobs.
98-
needs: [build_arm64, build_x86_64]
99-
if: |
100-
always() &&
101-
needs.build_arm64.result == 'success' &&
102-
needs.build_arm64.outputs.package_created &&
103-
needs.build_x86_64.result != 'failure'
104-
with:
105-
plan_artifact: arm64-build-plan
106-
dmg_artifact: arm64-dmg
107-
secrets:
108-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
109-
110-
# ----------------------------------------------------------------------------
111-
# Trigger update casks workflow in homebrew tap
112-
# ----------------------------------------------------------------------------
113-
114-
update_casks:
115-
name: Update Casks
116-
uses: ./.github/workflows/_update-casks.yml
117-
# Depend on both release jobs, but only run if either of them was
118-
# successful. This ensures we only run this job once all release jobs have
119-
# been completed.
120-
needs: [release_x86_64, release_arm64]
121-
if: >-
122-
always() &&
123-
github.event.inputs.test_build_name == '' &&
124-
contains(needs.*.result, 'success') &&
125-
!contains(needs.*.result, 'failure')
126-
secrets:
127-
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
28+
git_sha: ${{ inputs.git_sha }}
29+
x86_64: ${{ inputs.x86_64 }}
30+
arm64: ${{ inputs.arm64 }}
31+
test_build_name: "nightly-test"
32+
test_release_type: "draft"
33+
secrets: inherit

0 commit comments

Comments
 (0)