Skip to content

Commit de26455

Browse files
committed
hammerspoon: update CI to work on current GitHub runners
1 parent 56d4b20 commit de26455

File tree

2 files changed

+68
-24
lines changed

2 files changed

+68
-24
lines changed

.github/workflows/les_build.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
name: Build LES for macOS
2-
1+
name: Build
32
on: push
4-
53
jobs:
64
build:
7-
runs-on: macos-11
5+
runs-on: macos-12
6+
env:
7+
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
88
steps:
99
- name: Cloning Git repository
10-
uses: actions/checkout@v1
10+
uses: actions/checkout@v3
1111
with:
1212
submodules: 'recursive'
13-
- name: Prepare build environment
14-
run: ./scripts/github-ci-pre.sh
13+
- name: Setup Cocoapods
14+
uses: maxim-lobanov/setup-cocoapods@v1
15+
with:
16+
podfile-path: Podfile.lock
17+
- name: Setup Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '3.0'
21+
- name: Install dependencies
22+
run: |
23+
brew install coreutils jq xcbeautify gawk gh gpg
24+
pip3 install --user --disable-pip-version-check -r requirements.txt
25+
gem install --user t
26+
gem install trainer
1527
- name: Attempt to build the Live Enhancement Suite for macOS
28+
shell: bash
1629
run: |
17-
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Hammerspoon -configuration Debug clean build | tee $(date +%s).log | xcbeautify
30+
export LOG_NAME="build_$(date +%s).log"
31+
export XCODE_ARGS="clean build"
32+
export XCODE_ARGS="${XCODE_ARGS} GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO GCC_TREAT_WARNINGS_AS_ERRORS=NO CLANG_ENABLE_CODE_COVERAGE=NO"
33+
export XCODE_ARGS="${XCODE_ARGS} -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO"
34+
export XCODE_ARGS="${XCODE_ARGS} SDKROOT=${DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk"
35+
export XCODE_ARGS="${XCODE_ARGS} MACOSX_DEPLOYMENT_TARGET=11.0"
36+
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release -configuration Release ${XCODE_ARGS} | \
37+
tee ${LOG_NAME} | \
38+
xcbeautify && exit ${PIPESTATUS[0]}

.github/workflows/les_release.yml

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,70 @@
1-
name: Release LES for macOS
2-
1+
name: Publish
32
on:
43
push:
54
tags:
6-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7-
5+
- 'v*'
6+
permissions:
7+
contents: write
88
jobs:
99
build:
10-
runs-on: macos-11
10+
runs-on: macos-12
11+
env:
12+
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
1113
steps:
1214
- name: Cloning Git repository
13-
uses: actions/checkout@v1
15+
uses: actions/checkout@v3
1416
with:
1517
submodules: 'recursive'
16-
- name: Prepare build environment
17-
run: ./scripts/github-ci-pre.sh
18+
- name: Setup Cocoapods
19+
uses: maxim-lobanov/setup-cocoapods@v1
20+
with:
21+
podfile-path: Podfile.lock
22+
- name: Setup Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: '3.0'
26+
- name: Install dependencies
27+
run: |
28+
brew install coreutils jq xcbeautify gawk gh gpg
29+
pip3 install --user --disable-pip-version-check -r requirements.txt
30+
gem install --user t
31+
gem install trainer
1832
- name: Attempt to build the Live Enhancement Suite for macOS
33+
shell: bash
1934
run: |
20-
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Hammerspoon -configuration Debug clean build | tee $(date +%s).log | xcbeautify
35+
export LOG_NAME="build_$(date +%s).log"
36+
export XCODE_ARGS="clean build"
37+
export XCODE_ARGS="${XCODE_ARGS} GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO GCC_TREAT_WARNINGS_AS_ERRORS=NO CLANG_ENABLE_CODE_COVERAGE=NO"
38+
export XCODE_ARGS="${XCODE_ARGS} -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO"
39+
export XCODE_ARGS="${XCODE_ARGS} SDKROOT=${DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk"
40+
export XCODE_ARGS="${XCODE_ARGS} MACOSX_DEPLOYMENT_TARGET=11.0"
41+
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release -configuration Release ${XCODE_ARGS} | \
42+
tee ${LOG_NAME} | \
43+
xcbeautify && exit ${PIPESTATUS[0]}
2144
- name: Copy Hammerspoon binary to root for disk image packaging
2245
run: |
2346
mkdir release
24-
ditto $HOME/Library/Developer/Xcode/DerivedData/Hammerspoon-*/Build/Products/Debug/*.app/ ./Live\ Enhancement\ Suite.app/
47+
cp -Rv ${HOME}/Library/Developer/Xcode/DerivedData/*/Build/Products/Release/*.app/ ./Live\ Enhancement\ Suite.app/
2548
- name: Set up environment for disk image creation
26-
uses: actions/setup-node@v1
49+
uses: actions/setup-node@v3
2750
with:
28-
node-version: '10.x'
51+
node-version: '14.x'
2952
- name: Create Live Enhancement Suite disk image
3053
run: |
3154
npm install -g create-dmg
3255
create-dmg --dmg-title="Live Enhancement Suite" Live\ Enhancement\ Suite.app release 2>&1 || true
33-
mv release/*.dmg release/LiveEnhancementSuite.dmg
34-
shasum release/*.dmg >> release/CHECKSUM_SHA256.txt
56+
mv -v release/*.dmg release/LiveEnhancementSuite.dmg
57+
shasum release/*.dmg | tee release/CHECKSUM_SHA256.txt
3558
- name: Upload disk image as release asset
36-
uses: svenstaro/upload-release-action@v1-release
59+
uses: svenstaro/upload-release-action@v2
3760
with:
3861
repo_token: ${{ secrets.GITHUB_TOKEN }}
3962
file: release/LiveEnhancementSuite.dmg
4063
asset_name: LiveEnhancementSuite.dmg
4164
tag: ${{ github.ref }}
4265
overwrite: true
4366
- name: Upload checksum as release asset
44-
uses: svenstaro/upload-release-action@v1-release
67+
uses: svenstaro/upload-release-action@v2
4568
with:
4669
repo_token: ${{ secrets.GITHUB_TOKEN }}
4770
file: release/CHECKSUM_SHA256.txt

0 commit comments

Comments
 (0)