Skip to content

Commit 212b55a

Browse files
committed
hammerspoon: update CI to work on current GitHub runners
1 parent c4869f9 commit 212b55a

File tree

5 files changed

+96
-72
lines changed

5 files changed

+96
-72
lines changed

.github/workflows/les_build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: macos-11
6+
env:
7+
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
8+
steps:
9+
- name: Cloning Git repository
10+
uses: actions/checkout@v3
11+
with:
12+
submodules: 'recursive'
13+
- name: Install dependencies
14+
run: |
15+
brew install coreutils jq xcbeautify gawk gh gpg
16+
- name: Attempt to build the Live Enhancement Suite for macOS
17+
shell: bash
18+
run: |
19+
export LOG_NAME="build_$(date +%s).log"
20+
export XCODE_ARGS="clean build"
21+
export XCODE_ARGS="${XCODE_ARGS} GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO GCC_TREAT_WARNINGS_AS_ERRORS=NO CLANG_ENABLE_CODE_COVERAGE=NO"
22+
export XCODE_ARGS="${XCODE_ARGS} -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO"
23+
export XCODE_ARGS="${XCODE_ARGS} SDKROOT=${DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"
24+
export XCODE_ARGS="${XCODE_ARGS} MACOSX_DEPLOYMENT_TARGET=10.12"
25+
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release -configuration Release ${XCODE_ARGS} | \
26+
tee ${LOG_NAME} | \
27+
xcbeautify && exit ${PIPESTATUS[0]}

.github/workflows/les_release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
permissions:
7+
contents: write
8+
jobs:
9+
build:
10+
runs-on: macos-11
11+
env:
12+
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
13+
steps:
14+
- name: Cloning Git repository
15+
uses: actions/checkout@v3
16+
with:
17+
submodules: 'recursive'
18+
- name: Install dependencies
19+
run: |
20+
brew install coreutils jq xcbeautify gawk gh gpg
21+
- name: Attempt to build the Live Enhancement Suite for macOS
22+
shell: bash
23+
run: |
24+
export LOG_NAME="build_$(date +%s).log"
25+
export XCODE_ARGS="clean build"
26+
export XCODE_ARGS="${XCODE_ARGS} GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO GCC_TREAT_WARNINGS_AS_ERRORS=NO CLANG_ENABLE_CODE_COVERAGE=NO"
27+
export XCODE_ARGS="${XCODE_ARGS} -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO"
28+
export XCODE_ARGS="${XCODE_ARGS} SDKROOT=${DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"
29+
export XCODE_ARGS="${XCODE_ARGS} MACOSX_DEPLOYMENT_TARGET=10.12"
30+
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release -configuration Release ${XCODE_ARGS} | \
31+
tee ${LOG_NAME} | \
32+
xcbeautify && exit ${PIPESTATUS[0]}
33+
- name: Copy Hammerspoon binary to root for disk image packaging
34+
run: |
35+
mkdir release
36+
cp -Rv ${HOME}/Library/Developer/Xcode/DerivedData/*/Build/Products/Release/*.app/ ./Live\ Enhancement\ Suite.app/
37+
- name: Set up environment for disk image creation
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: '14.x'
41+
- name: Create Live Enhancement Suite disk image
42+
run: |
43+
npm install -g create-dmg
44+
create-dmg --dmg-title="Live Enhancement Suite" Live\ Enhancement\ Suite.app release 2>&1 || true
45+
mv -v release/*.dmg release/LiveEnhancementSuite.dmg
46+
shasum release/*.dmg | tee release/CHECKSUM_SHA256.txt
47+
- name: Upload disk image as release asset
48+
uses: svenstaro/upload-release-action@v2
49+
with:
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: release/LiveEnhancementSuite.dmg
52+
asset_name: LiveEnhancementSuite.dmg
53+
tag: ${{ github.ref }}
54+
overwrite: true
55+
- name: Upload checksum as release asset
56+
uses: svenstaro/upload-release-action@v2
57+
with:
58+
repo_token: ${{ secrets.GITHUB_TOKEN }}
59+
file: release/CHECKSUM_SHA256.txt
60+
asset_name: CHECKSUM_SHA256.txt
61+
tag: ${{ github.ref }}
62+
overwrite: true

.github/workflows/main.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

extensions/httpserver/mkCertTemplate.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/bin/bash
2+
3+
set -eux
4+
set -o pipefail
5+
26
echo "== Generating a private key and using it to sign an x509:"
3-
openssl req -x509 -newkey rsa:2048 -outform DER -out cert.cer -config openssl.conf -set_serial 106 >/dev/null
7+
/usr/bin/openssl req -x509 -newkey rsa:2048 -outform DER -out cert.cer -config openssl.conf -set_serial 106 >/dev/null
48

59
echo ""
610

711
echo "== Dumping ASN.1 structure of cert.cer:"
8-
openssl asn1parse -inform DER -in cert.cer -dump -i >cert.cer.asn1
12+
/usr/bin/openssl asn1parse -inform DER -in cert.cer -dump -i >cert.cer.asn1
913

1014
echo ""
1115

@@ -32,7 +36,7 @@ echo "#define kCSRLength ${CSR_LENGTH}u" >>${INCLUDE_FILE}
3236
echo "" >>${INCLUDE_FILE}
3337

3438
echo "=== Dumping template certificate bytes..."
35-
openssl x509 -C -inform DER -in cert.cer -noout | sed -n '/XXX_certificate/,$p' | sed -e 's/unsigned char XXX_certificate/static uint8_t const kCertTemplate/' >>${INCLUDE_FILE}
39+
/usr/bin/openssl x509 -C -inform DER -in cert.cer -noout | sed -n '/XXX_certificate/,$p' | sed -e 's/unsigned char XXX_certificate/static uint8_t const kCertTemplate/' >>${INCLUDE_FILE}
3640

3741
echo "=== Tidying..."
3842
rm -rv cert.cer

0 commit comments

Comments
 (0)