-
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (60 loc) · 2.34 KB
/
release-app.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
name: release app
on:
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
release-ios:
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1.0'
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
skipInvalidTags: true
noVersionBumpBehavior: "error"
majorList: "major, breaking"
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version in Config.xcconfig
run: |
CURRENT_BUILD=$(grep BUILD_NUMBER CoreDex/Config.xcconfig | cut -d ' ' -f 3)
NEW_BUILD=$((CURRENT_BUILD + 1))
sed -i '' "s/BUILD_NUMBER = $CURRENT_BUILD/BUILD_NUMBER = $NEW_BUILD/" CoreDex/Config.xcconfig
CURRENT_VERSION=$(grep VERSION CoreDex/Config.xcconfig | cut -d ' ' -f 3)
NEW_VERSION=${{ steps.semver.outputs.nextStrict }}
sed -i '' "s/VERSION = $CURRENT_VERSION/VERSION = $NEW_VERSION/" CoreDex/Config.xcconfig
- name: Commit & Push changes
uses: EndBug/add-and-commit@v9
with:
add: 'CoreDex/Config.xcconfig'
default_author: github_actions
fetch: false
message: 'Bump version [skip ci]'
push: true
- name: Build iOS app
run: xcodebuild -scheme CoreDex -sdk iphoneos -configuration Release -derivedDataPath build -destination generic/platform=iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- name: Pack .ipa from .app
run: |
mkdir -p build/Build/Products/Release-iphoneos/Payload
mv build/Build/Products/Release-iphoneos/CoreDex.app build/Build/Products/Release-iphoneos/Payload/
cd build/Build/Products/Release-iphoneos
zip -r ../../../CoreDex.ipa Payload
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.semver.outputs.next }}
files: ./build/CoreDex.ipa
fail_on_unmatched_files: true
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}