release: build aarch64 artifacts for macos on GitHub Actions
Before adoption: this commit came in with the history the project adopted, so no landing records it.
GitHub now supports this natively, so there's no need for me to do it any more. Fixes #3155
authored by Andrew Gallant · committed by Andrew Gallant · parent 8b5d3d1 · Browse files · 4 files·+6 added−45 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+6 added−45 removed
- other:+6 added−45 removed
Provenance
- Commit
c1fc6a5- Tree
c4dacf9- Author
Andrew Gallant <jamslam@gmail.com>- Committer
Andrew Gallant <jamslam@gmail.com>- Parent
8b5d3d1
4 files changed+6 added−45 removed
modified:.github/workflows/release.yml+4 added
112 unmodified lines113 - build: macos114 os: macos-latest115 rust: nightly116 target: x86_64-apple-darwin117+ - build: macos118+ os: macos-latest119+ rust: nightly120+ target: aarch64-apple-darwin121 - build: win-msvc122 os: windows-latest123 rust: nightly124 target: x86_64-pc-windows-msvc255 unmodified linesdeleted:ci/build-and-publish-m2-43 removed
1-#!/bin/bash2-3-# This script builds a ripgrep release for the aarch64-apple-darwin target.4-# At time of writing (2023-11-21), GitHub Actions does not free Apple silicon5-# runners. Since I have somewhat recently acquired an M2 mac mini, I just use6-# this script to build the release tarball and upload it with `gh`.7-#8-# Once GitHub Actions has proper support for Apple silicon, we should add it9-# to our release workflow and drop this script.10-11-set -e12-13-version="$1"14-if [ -z "$version" ]; then15- echo "missing version" >&216- echo "Usage: "$(basename "$0")" <version>" >&217- exit 118-fi19-if ! grep -q "version = \"$version\"" Cargo.toml; then20- echo "version does not match Cargo.toml" >&221- exit 122-fi23-24-target=aarch64-apple-darwin25-cargo build --release --features pcre2 --target $target26-BIN=target/$target/release/rg27-NAME=ripgrep-$version-$target28-ARCHIVE="deployment/m2/$NAME"29-30-mkdir -p "$ARCHIVE"/{complete,doc}31-cp "$BIN" "$ARCHIVE"/32-strip "$ARCHIVE/rg"33-cp {README.md,COPYING,UNLICENSE,LICENSE-MIT} "$ARCHIVE"/34-cp {CHANGELOG.md,FAQ.md,GUIDE.md} "$ARCHIVE"/doc/35-"$BIN" --generate complete-bash > "$ARCHIVE/complete/rg.bash"36-"$BIN" --generate complete-fish > "$ARCHIVE/complete/rg.fish"37-"$BIN" --generate complete-powershell > "$ARCHIVE/complete/_rg.ps1"38-"$BIN" --generate complete-zsh > "$ARCHIVE/complete/_rg"39-"$BIN" --generate man > "$ARCHIVE/doc/rg.1"40-41-tar c -C deployment/m2 -z -f "$ARCHIVE.tar.gz" "$NAME"42-shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256"43-gh release upload "$version" "$ARCHIVE.tar.gz" "$ARCHIVE.tar.gz.sha256"modified:CHANGELOG.md+2 added
31 unmodified lines32 * [BUG #3108](https://github.com/BurntSushi/ripgrep/issues/3108):33 Fix a bug where `-q --files-without-match` inverted the exit code.34 * [BUG #3140](https://github.com/BurntSushi/ripgrep/issues/3140):35 Ensure hyphens in flag names are escaped in the roff text for the man page.36+* [BUG #3155](https://github.com/BurntSushi/ripgrep/issues/3155):37+ Statically compile PCRE2 into macOS release artifacts on `aarch64`.38 39 Feature enhancements:40 41 * Many enhancements to the default set of file types available for filtering.1733 unmodified linesmodified:RELEASE-CHECKLIST.md-2 removed
39 unmodified lines4041424344454445464710 unmodified lines39 unmodified lines > In case you haven't heard of it before, ripgrep is a line-oriented search > tool that recursively searches the current directory for a regex pattern. > By default, ripgrep will respect gitignore rules and automatically skip > hidden files/directories and binary files.* Run `git checkout {VERSION} && ci/build-and-publish-m2 {VERSION}` on a macOS system with Apple silicon.* Run `cargo publish`.* Run `ci/sha256-releases {VERSION} >> pkg/brew/ripgrep-bin.rb`. Then edit `pkg/brew/ripgrep-bin.rb` to update the version number and sha256 hashes. Remove extraneous stuff added by `ci/sha256-releases`. Commit changes.10 unmodified lines