mirror of
https://github.com/jimeh/emacs-builds.git
synced 2026-02-19 13:06:40 +00:00
Compare commits
13 Commits
Emacs.2021
...
Emacs.2021
| Author | SHA1 | Date | |
|---|---|---|---|
|
56d9178919
|
|||
|
29f5577efe
|
|||
|
8544a650ab
|
|||
|
31a12fc502
|
|||
|
cec5748301
|
|||
|
f5ccfd297a
|
|||
|
6d95b9e550
|
|||
|
3072334b7f
|
|||
|
813835a540
|
|||
|
52ec1c6a6b
|
|||
|
3a96925657
|
|||
|
aaa4aa947d
|
|||
|
c6b1e95f4c
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -2,7 +2,7 @@
|
||||
name: Build
|
||||
on:
|
||||
schedule:
|
||||
- cron: "35 2 * * *"
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
gitRef:
|
||||
|
||||
103
.github/workflows/test-build.yml
vendored
Normal file
103
.github/workflows/test-build.yml
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
name: Test Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
gitRef:
|
||||
description: "Emacs git ref to build"
|
||||
required: true
|
||||
default: "master"
|
||||
releaseToolGitRef:
|
||||
description: "Git ref to checkout of emacs-builds (github-release)"
|
||||
required: true
|
||||
default: "main"
|
||||
buildScriptGitRef:
|
||||
description: "Git ref to checkout of build-emacs-for-macos"
|
||||
required: true
|
||||
default: "master"
|
||||
testBuildName:
|
||||
description: "Test build name"
|
||||
required: false
|
||||
default: ""
|
||||
testReleaseType:
|
||||
description: "prerelease or draft"
|
||||
required: true
|
||||
default: "prerelease"
|
||||
extraPlanArgs:
|
||||
Description: "Extra plan args"
|
||||
required: false
|
||||
default: ""
|
||||
extraBuildArgs:
|
||||
Description: "Extra build args"
|
||||
required: false
|
||||
default: ""
|
||||
extraReleaseArgs:
|
||||
Description: "Extra release args"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: macos-10.15
|
||||
steps:
|
||||
- name: Checkout emacs-builds repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.inputs.releaseToolGitRef }}
|
||||
path: releaser
|
||||
- name: Checkout build-emacs-for-macos repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: jimeh/build-emacs-for-macos
|
||||
ref: ${{ github.event.inputs.buildScriptGitRef }}
|
||||
path: builder
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Compile github-release tool
|
||||
run: >-
|
||||
go build -o ./github-release ./cmd/github-release
|
||||
working-directory: releaser
|
||||
- name: Plan build
|
||||
run: >-
|
||||
./releaser/github-release --plan plan.yml plan
|
||||
--work-dir '${{ github.workspace }}'
|
||||
--test-build
|
||||
--test-build-name="${{ github.event.inputs.testBuildName }}"
|
||||
--test-release-type="${{ github.event.inputs.testReleaseType }}"
|
||||
${{ github.event.inputs.extraPlanArgs }}
|
||||
${{ github.event.inputs.gitRef }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Show plan
|
||||
run: >-
|
||||
cat plan.yml
|
||||
- name: Check if planned release and asset already exist
|
||||
id: check
|
||||
continue-on-error: true
|
||||
run: >-
|
||||
./releaser/github-release --plan plan.yml check
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Install dependencies
|
||||
if: steps.check.outcome == 'failure'
|
||||
run: >-
|
||||
brew bundle --file=builder/Brewfile
|
||||
- name: Build Emacs
|
||||
if: steps.check.outcome == 'failure'
|
||||
run: >-
|
||||
./builder/build-emacs-for-macos --plan=plan.yml
|
||||
--work-dir '${{ github.workspace }}'
|
||||
--native-full-aot
|
||||
${{ github.event.inputs.extraReleaseArgs }}
|
||||
- name: Publish release
|
||||
if: steps.check.outcome == 'failure'
|
||||
run: >-
|
||||
./releaser/github-release --plan plan.yml publish
|
||||
--release-sha="${{ github.event.inputs.releaseToolGitRef }}"
|
||||
${{ github.event.inputs.extraReleaseArgs }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
80
README.md
80
README.md
@@ -1,6 +1,12 @@
|
||||
# Emacs Builds
|
||||
<p align="center">
|
||||
<img width="192px" src="https://github.com/emacs-mirror/emacs/raw/emacs-27.2/etc/images/icons/hicolor/scalable/apps/emacs.svg" alt="Logo">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<h1 align="center">
|
||||
Emacs Builds
|
||||
</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/jimeh/emacs-builds/releases">
|
||||
<img src="https://img.shields.io/github/v/tag/jimeh/emacs-builds?label=nightly" alt="GitHub tag (latest SemVer)">
|
||||
</a>
|
||||
@@ -13,44 +19,68 @@ alt="GitHub issues">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Nightly binary builds of Emacs for macOS, with native-compilation enabled, as a
|
||||
completely self-contained Emacs.app application bundle.
|
||||
<p align="center">
|
||||
<strong>
|
||||
Nightly binary builds of Emacs for macOS as a self-contained Emacs.app,
|
||||
with native-compilation.
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
## Features
|
||||
|
||||
- Self-contained Emacs.app application, with no external dependencies.
|
||||
- Self-contained Emacs.app application bundle, with no external dependencies,
|
||||
built with the [jimeh/build-emacs-for-macos][] build script.
|
||||
- Native-compilation is enabled in nightly builds from the `master` branch of
|
||||
Emacs, and should just work without the need to install GCC, libgccjit, or any
|
||||
other dependencies.
|
||||
- Includes the [fix-window-role][] and [system-appearance][] patches from the
|
||||
excellent [emacs-plus][] project.
|
||||
- Build are creation is transparent and public through the use of GitHub
|
||||
Actions, allowing anyone to inspect git commit SHAs, full source code, and
|
||||
exact commands used to produce a build. This is especially important right now
|
||||
as builds are not yet signed and notarized.
|
||||
- Emacs source is fetched from the [emacs-mirror/emacs][] GitHub repository.
|
||||
- Build creation is transparent and public through the use of GitHub Actions,
|
||||
allowing anyone to inspect git commit SHAs, full source code, and exact
|
||||
commands used to produce a build. This is especially important right now as
|
||||
builds are not yet signed and notarized.
|
||||
|
||||
[jimeh/build-emacs-for-macos]: https://github.com/jimeh/build-emacs-for-macos
|
||||
[fix-window-role]:
|
||||
https://github.com/d12frosted/homebrew-emacs-plus/blob/master/patches/emacs-28/fix-window-role.patch
|
||||
[system-appearance]:
|
||||
https://github.com/d12frosted/homebrew-emacs-plus/blob/master/patches/emacs-28/system-appearance.patch
|
||||
[emacs-plus]: https://github.com/d12frosted/homebrew-emacs-plus
|
||||
[emacs-mirror/emacs]: https://github.com/emacs-mirror/emacs
|
||||
|
||||
## System Requirements
|
||||
|
||||
- Intel-based Mac running macOS 10.15.x or later.
|
||||
|
||||
## Downloads
|
||||
|
||||
See the [Releases][] page to download latest builds.
|
||||
|
||||
Nightly builds of Emacs are for the part just fine, but if you don't like living
|
||||
too close to the edge, see issue [#7 Known Good Nightly Builds][7] for a list of
|
||||
recent nightly builds which have been actively used by a living being without
|
||||
any issues.
|
||||
|
||||
[releases]: https://github.com/jimeh/emacs-builds/releases
|
||||
[7]: https://github.com/jimeh/emacs-builds/issues/7
|
||||
|
||||
## Build Process
|
||||
|
||||
Building Emacs is done using the [jimeh/build-emacs-for-macos][] build script,
|
||||
executed within a GitHub Actions workflow. Full build history is available
|
||||
[here][actions].
|
||||
executed within a GitHub Actions [workflow][]. This is why macOS 10.15.x or
|
||||
later is required, as it's the oldest version of macOS available in GitHub
|
||||
Actions.
|
||||
|
||||
[workflow]:
|
||||
https://github.com/jimeh/emacs-builds/blob/main/.github/workflows/build.yml
|
||||
|
||||
Full history for all builds is available on GitHub Actions [here][actions].
|
||||
|
||||
[jimeh/build-emacs-for-macos]: https://github.com/jimeh/build-emacs-for-macos
|
||||
[actions]: https://github.com/jimeh/emacs-builds/actions
|
||||
|
||||
Nightly builds are scheduled for 2:35 UTC every night, based on the latest
|
||||
Nightly builds are scheduled for 0:00 UTC every night, based on the latest
|
||||
commit from the `master` branch of the [emacs-mirror/emacs][] repository. This
|
||||
means a nightly build will only be produced if there have been new commits since
|
||||
the last nightly build.
|
||||
@@ -60,22 +90,16 @@ the last nightly build.
|
||||
## Untrusted Application
|
||||
|
||||
Currently builds are not signed or notarized, meaning macOS cannot verify
|
||||
Emacs.app came from a trusted developer, and by default you are not even given
|
||||
the option to trust the app and open it anyway.
|
||||
Emacs.app came from a trusted developer, and by default you are not given an
|
||||
option to trust the app and open it.
|
||||
|
||||
Simplest way around this: Instead of double-clicking on Emacs.app in Finder,
|
||||
right-click (or control-click) on Emacs and select "Open". You will then be
|
||||
given the same warning as before, with a "Open" button now available to open the
|
||||
app anyway. After that you can open the application like normal without any
|
||||
warnings.
|
||||
Simplest way around this is to right-click (or control-click) on the Emacs app
|
||||
in Finder and select "Open". You will then be given the same warning as before,
|
||||
but with a "Open" button now available to trust and open the app. After that you
|
||||
can open the application like normal without any warnings.
|
||||
|
||||
## To-Do
|
||||
## Issues / To-Do
|
||||
|
||||
- [ ] Sign and notarize builds.
|
||||
- [ ] Builds for stable versions of Emacs.
|
||||
- [ ] Populate GitHub Release description with relevant info about the build,
|
||||
including a link to the GitHub Actions workflow run that produced the
|
||||
build.
|
||||
- [ ] (Eventually) support Apple Silicon mac builds when native-compilation
|
||||
actually works on Apple Silicon.
|
||||
- [ ] (Eventually) support builds for Linux.
|
||||
Please see [Issues][] for details of things to come, or to report issues.
|
||||
|
||||
[issues]: https://github.com/jimeh/emacs-builds/issues
|
||||
|
||||
@@ -27,15 +27,15 @@ func checkAction(c *cli.Context, opts *globalOptions) error {
|
||||
|
||||
fmt.Printf(
|
||||
"==> Checking github.com/%s for release: %s\n",
|
||||
repo.String(), plan.Release,
|
||||
repo.String(), plan.Release.Name,
|
||||
)
|
||||
|
||||
release, resp, err := gh.Repositories.GetReleaseByTag(
|
||||
c.Context, repo.Owner, repo.Name, plan.Release,
|
||||
c.Context, repo.Owner, repo.Name, plan.Release.Name,
|
||||
)
|
||||
if err != nil {
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
return fmt.Errorf("release %s does not exist", plan.Release)
|
||||
return fmt.Errorf("release %s does not exist", plan.Release.Name)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -6,11 +6,20 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type ReleaseType string
|
||||
|
||||
type Release struct {
|
||||
Name string `yaml:"name"`
|
||||
Title string `yaml:"title,omitempty"`
|
||||
Draft bool `yaml:"draft,omitempty"`
|
||||
Pre bool `yaml:"prerelease,omitempty"`
|
||||
}
|
||||
|
||||
type Plan struct {
|
||||
Commit *Commit `yaml:"commit"`
|
||||
OS *OSInfo `yaml:"os"`
|
||||
Release string `yaml:"release"`
|
||||
Archive string `yaml:"archive"`
|
||||
Commit *Commit `yaml:"commit"`
|
||||
OS *OSInfo `yaml:"os"`
|
||||
Release *Release `yaml:"release"`
|
||||
Archive string `yaml:"archive"`
|
||||
}
|
||||
|
||||
func LoadPlan(filename string) (*Plan, error) {
|
||||
|
||||
@@ -40,6 +40,21 @@ func planCmd() *cli.Command {
|
||||
Name: "sha",
|
||||
Usage: "Override commit SHA of specified git branch/tag",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "test-build",
|
||||
Usage: "Plan a test build, which is published to a draft " +
|
||||
"\"test-builds\" release",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "test-build-name",
|
||||
Usage: "Set a unique name to distinguish the ",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "test-release-type",
|
||||
Value: "prerelease",
|
||||
Usage: "Type of release when doing a test-build " +
|
||||
"(prerelease or draft)",
|
||||
},
|
||||
},
|
||||
Action: actionHandler(planAction),
|
||||
}
|
||||
@@ -78,20 +93,37 @@ func planAction(c *cli.Context, opts *globalOptions) error {
|
||||
cleanOS := sanitizeString(osInfo.Name + "-" + osInfo.ShortVersion())
|
||||
cleanArch := sanitizeString(osInfo.Arch)
|
||||
|
||||
releaseName := fmt.Sprintf(
|
||||
"Emacs.%s.%s.%s",
|
||||
commit.DateString(), commit.ShortSHA(), cleanRef,
|
||||
)
|
||||
release := &Release{
|
||||
Name: fmt.Sprintf(
|
||||
"Emacs.%s.%s.%s",
|
||||
commit.DateString(), commit.ShortSHA(), cleanRef,
|
||||
),
|
||||
}
|
||||
archiveName := fmt.Sprintf(
|
||||
"Emacs.%s.%s.%s.%s.%s.tbz",
|
||||
"Emacs.%s.%s.%s.%s.%s",
|
||||
commit.DateString(), commit.ShortSHA(), cleanRef, cleanOS, cleanArch,
|
||||
)
|
||||
|
||||
if c.Bool("test-build") {
|
||||
release.Title = "Test Builds"
|
||||
release.Name = "test-builds"
|
||||
if c.String("test-release-type") == "draft" {
|
||||
release.Draft = true
|
||||
} else {
|
||||
release.Pre = true
|
||||
}
|
||||
|
||||
archiveName += ".test"
|
||||
if t := c.String("test-build-name"); t != "" {
|
||||
archiveName += "." + sanitizeString(t)
|
||||
}
|
||||
}
|
||||
|
||||
plan := &Plan{
|
||||
Commit: commit,
|
||||
OS: osInfo,
|
||||
Release: releaseName,
|
||||
Archive: filepath.Join(buildsDir, archiveName),
|
||||
Release: release,
|
||||
Archive: filepath.Join(buildsDir, archiveName+".tbz"),
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
|
||||
@@ -24,12 +24,6 @@ func publishCmd() *cli.Command {
|
||||
Usage: "Git SHA of repo to create release on",
|
||||
EnvVars: []string{"GITHUB_SHA"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "prerelease",
|
||||
Usage: "Git SHA of repo to create release on",
|
||||
EnvVars: []string{"RELEASE_PRERELEASE"},
|
||||
Value: true,
|
||||
},
|
||||
},
|
||||
Action: actionHandler(publishAction),
|
||||
}
|
||||
@@ -44,7 +38,6 @@ func publishAction(c *cli.Context, opts *globalOptions) error {
|
||||
}
|
||||
|
||||
releaseSHA := c.String("release-sha")
|
||||
prerelease := c.Bool("prerelease")
|
||||
|
||||
assetBaseName := filepath.Base(plan.Archive)
|
||||
assetSumFile := plan.Archive + ".sha256"
|
||||
@@ -65,20 +58,34 @@ func publishAction(c *cli.Context, opts *globalOptions) error {
|
||||
fmt.Printf(" -> Done: %s\n", assetSum)
|
||||
}
|
||||
|
||||
fmt.Printf("==> Checking release %s\n", plan.Release)
|
||||
tagName := plan.Release.Name
|
||||
name := plan.Release.Title
|
||||
|
||||
if name == "" {
|
||||
name = tagName
|
||||
}
|
||||
|
||||
fmt.Printf("==> Checking release %s\n", tagName)
|
||||
|
||||
release, resp, err := gh.Repositories.GetReleaseByTag(
|
||||
c.Context, repo.Owner, repo.Name, plan.Release,
|
||||
c.Context, repo.Owner, repo.Name, plan.Release.Name,
|
||||
)
|
||||
if err != nil {
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
fmt.Println(" -> Release not found, creating...")
|
||||
|
||||
prerelease := false
|
||||
if !plan.Release.Draft && plan.Release.Pre {
|
||||
prerelease = true
|
||||
}
|
||||
|
||||
release, _, err = gh.Repositories.CreateRelease(
|
||||
c.Context, repo.Owner, repo.Name, &github.RepositoryRelease{
|
||||
Name: &plan.Release,
|
||||
TagName: &plan.Release,
|
||||
Name: &name,
|
||||
TagName: &tagName,
|
||||
TargetCommitish: &releaseSHA,
|
||||
Prerelease: &prerelease,
|
||||
Draft: &plan.Release.Draft,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -89,8 +96,19 @@ func publishAction(c *cli.Context, opts *globalOptions) error {
|
||||
}
|
||||
}
|
||||
|
||||
if release.GetPrerelease() != prerelease {
|
||||
release.Prerelease = &prerelease
|
||||
if release.GetName() != name {
|
||||
release.Name = &name
|
||||
|
||||
release, _, err = gh.Repositories.EditRelease(
|
||||
c.Context, repo.Owner, repo.Name, release.GetID(), release,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if !plan.Release.Draft && release.GetPrerelease() != plan.Release.Pre {
|
||||
release.Prerelease = &plan.Release.Pre
|
||||
|
||||
release, _, err = gh.Repositories.EditRelease(
|
||||
c.Context, repo.Owner, repo.Name, release.GetID(), release,
|
||||
|
||||
Reference in New Issue
Block a user