-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (65 loc) · 3.28 KB
/
release.yaml
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
name: Create Release
on:
push:
branches:
- "release/*"
env:
DEVELOPER_DIR: /Applications/Xcode_12.1.app/Contents/Developer
# FYI diff between author and committer: https://stackoverflow.com/a/18754896
# For commits
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: GitHub Runner (eXtenderZ)
# For tags
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: GitHub Runner (eXtenderZ)
jobs:
bump-version-compile-and-tag:
name: Bump Build Version, Build and Tag
runs-on: [macos-10.15]
steps:
- name: Install hagvtool and swift-sh
# If brew is not up-to-date, `brew install --cask` might not exist
run: |
brew install --cask happn-app/public/hagvtool || brew cask install happn-app/public/hagvtool
brew install mxcl/made/swift-sh
- name: Import GPG Signing Key
run: gpg --import --pinentry-mode=loopback --passphrase '' <<<'${{ secrets.GPG_PRIVATE_KEY }}'
- name: Checkout eXtenderZ versioning
uses: actions/checkout@v2
with:
ref: "versioning"
- name: Bump Build Version in versioning Branch
run: |
set -euo pipefail
BUILD_VERSION_FILE=eXtenderZ_version.txt
echo $(($(cat "$BUILD_VERSION_FILE") + 1)) >"$BUILD_VERSION_FILE"
git commit "$BUILD_VERSION_FILE" -m "Bump build version"
# Note: This might fail if someone pushed a version from another
# branch. We do not auto-retry for now because this is very
# unlikely to happen for this repository.
git push
cp -f "$BUILD_VERSION_FILE" ../new_build_version
- name: Checkout eXtenderZ
uses: actions/checkout@v2
- name: Set Build Versions, Build xcframeworks and Push Tag
run: |
set -euo pipefail
NEW_MARKETING_VERSION="$(basename "$GITHUB_REF")"
test -n "$NEW_MARKETING_VERSION"
NEW_BUILD_VERSION="$(cat ../new_build_version)"
rm -f ../new_build_version
eval hagvtool set-build-version --targets\ eXtenderZ-{static,dynamic}-{macOS,iOS,tvOS,watchOS} "$NEW_BUILD_VERSION"
eval hagvtool set-marketing-version --targets\ eXtenderZ-{static,dynamic}-{macOS,iOS,tvOS,watchOS} "$NEW_MARKETING_VERSION"
TAG_NAME="$NEW_MARKETING_VERSION"
git commit --allow-empty -am "Set build version to $NEW_BUILD_VERSION and marketing version to $NEW_MARKETING_VERSION with hagvtool"
./Scripts/create_xcframeworks.swift "$NEW_MARKETING_VERSION"
git add Package.swift
git commit -am "Create the Package.swift file for SPM-compatibility"
git tag -sm "eXtenderZ $NEW_MARKETING_VERSION" "$TAG_NAME"
git push origin "$TAG_NAME"
- uses: actions/upload-artifact@v2
with:
name: xcframeworks
path: |
build/eXtenderZ-dynamic.xcframework.zip
build/eXtenderZ-static.xcframework.zip