forked from pwsafe/pwsafe
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 3.72 KB
/
macos-latest.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This is a basic workflow to help you get started with Actions
name: mac-pwsafe
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
permissions:
contents: read
jobs:
build_mac_pwsafe:
name: Build pwsafe for macOS
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set build parameters
# If you need to rebuild wxWidgets for some reason, say you changed the build params, just increment FORCE_REBUILD_WX
run: |
echo "WX_VERS=3.0.5" >> $GITHUB_ENV
echo "MACOS_VER_MIN=10.9" >> $GITHUB_ENV
echo "WX_SRC_DIR=$HOME/wxWidgets" >> $GITHUB_ENV
echo "WX_BUILD_DIR=$HOME/wxbuild" >> $GITHUB_ENV
echo "XCODE_VER=14.0.1" >> $GITHUB_ENV
echo "FORCE_REBUILD_WX=2" >> $GITHUB_ENV
- name: Force compatible Xcode version
run: sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app/Contents/Developer
- name: Print Xcode version in use
run: xcode-select -p
- name: Cache wxWidgets build
id: cache-wxWidgets-build
uses: actions/cache@v2
with:
path: ${{ env.WX_BUILD_DIR }}
key: wx-${{ env.WX_VERS }}-macOS-${{ env.MACOS_VER_MIN }}-Xcode-${{ env.XCODE_VER }}-build-${{ env.FORCE_REBUILD_WX }}
- name: Checkout wxWidgets
if: steps.cache-wxWidgets-build.outputs.cache-hit != 'true'
run: git clone https://github.com/wxWidgets/wxWidgets.git $WX_SRC_DIR
- name: Build wxWidgets
if: steps.cache-wxWidgets-build.outputs.cache-hit != 'true'
working-directory: ${{ env.WX_SRC_DIR }}
run: |
git pull --ff-only origin
git -C $WX_SRC_DIR reset --hard v${{ env.WX_VERS }}
git -C $WX_SRC_DIR submodule update --init
rm -rf $WX_BUILD_DIR
mkdir -p $WX_BUILD_DIR
cd $WX_SRC_DIR
# use built-in versions of jpeg, tiff & png libs to avoid linking with those in /usr/local/opt
./configure --prefix=$WX_BUILD_DIR --disable-shared --enable-unicode --with-macosx-version-min=$MACOS_VER_MIN --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --without-liblzma
make
make install
du -sh $WX_BUILD_DIR
- name: Generate xcconfigs
working-directory: ${{ github.workspace }}
run: Xcode/generate-configs -r $WX_BUILD_DIR/bin/wx-config > Xcode/pwsafe-release.xcconfig
- name: Build pwsafe
working-directory: ${{ github.workspace }}
run: xcodebuild -project Xcode/pwsafe-xcode6.xcodeproj -scheme pwsafe
- name: Get Xcode build output location
run: echo "BUILD_OUTPUT_DIR=$(xcodebuild -showBuildSettings -project Xcode/pwsafe-xcode6.xcodeproj | fgrep CONFIGURATION_BUILD_DIR | cut -d= -f2 | sed 's/^ *\(.*\)/\1/')" >> $GITHUB_ENV
- name: Move app to another folder
run: mkdir "$BUILD_OUTPUT_DIR"/app && mv "$BUILD_OUTPUT_DIR"/pwsafe.app "$BUILD_OUTPUT_DIR"/app/
- name: Install dependencies for creating dmg
run: brew install create-dmg
- name: Create dmg
run: create-dmg --volname "Password Safe" --volicon "src/ui/wxWidgets/graphics/pwsafe.icns" --eula LICENSE ${{ github.workspace }}/PasswordSafe.dmg "$BUILD_OUTPUT_DIR/app"
- name: Upload artifacts
uses: 'actions/upload-artifact@v2'
with:
name: PasswordSafe.${{ github.sha }}.dmg
path: ${{ github.workspace }}/PasswordSafe.dmg