-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (62 loc) · 2.46 KB
/
xcode.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: xcode - build
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
jobs:
build:
name: latest macos x
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: mxcl/xcodebuild@v2
with:
xcode: ^14
action: none
- name: Build
run: |
pod install
xcodebuild -configuration Debug -workspace QuickLookXD.xcworkspace -scheme QuickLookXD clean build -quiet
# Create variables to use in packaging
export BUNDLE_FILEPATH="$(xcodebuild -configuration Debug -workspace QuickLookXD.xcworkspace -scheme QuickLookXD -showBuildSettings 2>&1 | grep CODESIGNING_FOLDER_PATH | cut -d '=' -f2 | tr -d '[:space:]')"
export BUNDLE_PATH=$(dirname "${BUNDLE_FILEPATH}")
export BUNDLE_FILE=$(basename "${BUNDLE_FILEPATH}")
export PUBLISH_DIR="/tmp/quicklookxdist"
export PUBLISH_ZIP="bundle.zip"
# Enter the built generator bundle directory
echo "[${BUNDLE_PATH}]:"
cd "${BUNDLE_PATH}" && ls
# Archive the built generator as a zip file
echo "BUNDLE: ${BUNDLE_FILE} >>> ${PUBLISH_ZIP}"
zip -9qr "${PUBLISH_ZIP}" "${BUNDLE_FILE}"
echo "[$(pwd)]:" && ls "${PUBLISH_ZIP}"
# Ensure the directory to publish exists
echo "CREATE: ${PUBLISH_DIR}"
mkdir -p "${PUBLISH_DIR}"
# Move the bundle zip to the publish path
echo "MOVING: ${PUBLISH_ZIP} >>> ${PUBLISH_DIR}"
cp "${PUBLISH_ZIP}" "${PUBLISH_DIR}"
echo "[${PUBLISH_DIR}]:" && ls "${PUBLISH_DIR}"
# Make the packaging variables available
echo "BUNDLE_PATH=${BUNDLE_PATH}" >> "$GITHUB_ENV"
echo "BUNDLE_FILE=${BUNDLE_FILE}" >> "$GITHUB_ENV"
echo "PUBLISH_DIR=${PUBLISH_DIR}" >> "$GITHUB_ENV"
echo "PUBLISH_ZIP=${PUBLISH_ZIP}" >> "$GITHUB_ENV"
- name: Release
uses: peaceiris/actions-gh-pages@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
publish_branch: dist
destination_dir: ${{ github.sha }}
keep_files: true
- uses: actions/upload-artifact@v3
with:
path: |
${{ env.BUNDLE_PATH }}/${{ env.BUNDLE_FILE }}
${{ env.BUNDLE_PATH }}/${{ env.PUBLISH_ZIP }}
retention-days: 13