Skip to content

Commit

Permalink
Fix github action build
Browse files Browse the repository at this point in the history
  • Loading branch information
railwaycat committed Aug 7, 2023
1 parent 1a6a231 commit 2a9d091
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/emacs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: set env variables
run: |
echo "EMACS_VER=29.1" >> $GITHUB_ENV
echo "MACPORT_VER=$MACPORT_VER-mac-10.0" >> $GITHUB_ENV
echo "COMMIT_HASH=65c6c96f27afa446df6f9d8eff63f9cc012cc738" >> $GITHUB_ENV
echo "OUTPUT_DIR=build_out" >> $GITHUB_ENV
- name: get current time
run: echo "REL_DATE=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: get OS version
run: echo "OS_VER=$(sw_vers -productVersion)" >> $GITHUB_ENV

- name: prepare
run: ./build-scripts/prepare_homebrew.sh
run: pushd build-scripts; ./prepare_homebrew.sh; popd

- name: build and pack
run: |
pushd build-scripts
./fetch-emacs-mac-port.sh "28.2-mac-9.1"
./build-emacs.sh emacs-source "28.2"
pushd emacs-source; ../copylib.rb $(brew --prefix); popd
./make-zipball.sh emacs-source/tmproot "28.2-mac-9.1"
ls -d $PWD/emacs-source/tmproot/*.zip
./fetch-emacs-mac-port.sh "${{ env.MACPORT_VER }}" "${{ env.COMMIT_HASH }}" "${{ env.OUTPUT_DIR }}"
./build-emacs.sh "${{ env.OUTPUT_DIR }}" "${{ env.EMACS_VER }}"
pushd "${{ env.OUTPUT_DIR }}"; ../copylib.rb $(brew --prefix); popd
./make-zipball.sh "${{ env.OUTPUT_DIR }}/tmproot" "${{ env.MACPORT_VER }}"
ls -d ${{ env.OUTPUT_DIR }}/tmproot/*.zip
popd
- name: publish
Expand All @@ -34,7 +40,7 @@ jobs:
name: ${{ matrix.os }}-${{ env.REL_DATE }}
draft: true
files: |
build-scripts/emacs-source/tmproot/emacs-28.2-mac-9.1-${{ env.OS_VER }}.zip
build-scripts/emacs-source/tmproot/emacs-28.2-mac-9.1-${{ env.OS_VER }}-spacemacs-icon.zip
build-scripts/${{ env.OUTPUT_DIR }}/tmproot/emacs-${{ env.MACPORT_VER }}-${{ env.OS_VER }}.zip
build-scripts/${{ env.OUTPUT_DIR }}/tmproot/emacs-${{ env.MACPORT_VER }}-${{ env.OS_VER }}-spacemacs-icon.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion build-scripts/Brewfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tap "homebrew/bundle"
brew "autoconf"
brew "automake"
brew "gnutls"
# brew "gnutls"
brew "pkg-config"
brew "texinfo"
brew "jansson"
Expand Down
22 changes: 22 additions & 0 deletions build-scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

EMACS_VER="29.1"
MACPORT_VER="$EMACS_VER-mac-10.0"
COMMIT_HASH="65c6c96f27afa446df6f9d8eff63f9cc012cc738"
OUTPUT_DIR="build_out"

./prepare_homebrew.sh

./fetch-emacs-mac-port.sh "$MACPORT_VER" "$COMMIT_HASH" "$OUTPUT_DIR"

./build-emacs.sh "$OUTPUT_DIR" "$EMACS_VER"

pushd "$OUTPUT_DIR"
../copylib.rb $(brew --prefix)
# ../copylib.rb "@loader_path"
popd
./make-zipball.sh "$OUTPUT_DIR/tmproot" "$MACPORT_VER"

ls -d $OUTPUT_DIR/tmproot/*.zip
7 changes: 4 additions & 3 deletions build-scripts/prepare_homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ brew update
# remove all installed formula and reinstall from Brewfile, prevent waste time
# on upgrade all
# brew remove --force $(brew list --formula)
brew bundle --file $(pwd)/build-scripts/Brewfile
brew bundle --file ./Brewfile

# output the version of gnutls
brew info gnutls
# build gnutls from source code, to ensure the absolute path for
# linked libs
brew install --build-from-source gnutls

0 comments on commit 2a9d091

Please sign in to comment.