-
-
Notifications
You must be signed in to change notification settings - Fork 70
76 lines (67 loc) · 2.64 KB
/
build_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
name: Build and Release
on:
pull_request:
branches:
- alpha #change to production after testing
#ypes: [closed] ##TODO: Remove after testing
jobs:
build_and_release:
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.0.1'
- name: Extract Version and Build Number
id: extract_version_build_number
run: |
version=$(grep -m 1 -o 'MARKETING_VERSION\s*=\s*[^;]*' winston.xcodeproj/project.pbxproj | sed 's/MARKETING_VERSION = //')
build_number=$(grep -m 1 -o 'CURRENT_PROJECT_VERSION\s*=\s*[^;]*' winston.xcodeproj/project.pbxproj | sed 's/CURRENT_PROJECT_VERSION = //')
if [ -z "$version" ]; then
echo "Version not set"
version=""
fi
if [ -z "$build_number" ]; then
build_number="-$build_number"
fi
if [ -z "$build_number" ]; then
echo "Build Number not set"
build_number=""
fi
if [ -z "$build_number" ]; then
build_number="-$buid_number"
fi
#TODO: Does this work?
echo "::set-output name=version::$version"
echo "::set-output name=build_number::$build_number"
- name: Read release body from whattotest file
id: read_file
# For some reason this works only with the deprecated output syntax
run: |
release_body=$(cat TestFlight/WhatToTest.en-US.txt)
echo "::set-output name=release_body::$release_body"
- name: Build and Archive App
uses: sparkfabrik/[email protected]
with:
apple-key-id: ${{ secrets.APPLE_KEY_ID }}
apple-key-issuer-id: ${{ secrets.APPLE_KEY_ISSUER_ID }}
apple-key-content: ${{ secrets.APPLE_KEY_CONTENT }}
project-path: winston.xcodeproj
export-method: ad-hoc
match-build-type: ad-hoc
scheme: winston
output-path: $PWD/build/Winston.ipa
team-id: Z2NNLU4F7U
team-name: "lo.cafe"
ios-app-id: lo.cafe.winston
upload-to-testflight: false
increment-build-number: false
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
files: $PWD/build/Winston.ipa
tag_name: Winston-v-${{ steps.extract_version_build_number.outputs.version }}${{ steps.extract_version_build_number.outputs.build_number }}
name: "Winston-v-${{ steps.extract_version_build_number.outputs.version }}${{ steps.extract_version_build_number.outputs.build_number }}"
body: ${{ steps.read_file.outputs.release_body }}