-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.67 KB
/
release.yml
File metadata and controls
85 lines (71 loc) · 2.67 KB
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
name: iOS Release
on:
pull_request:
types:
- closed
branches:
- main
env:
RUBY_VERSION: "3.2"
XCODE_VERSION: latest
APP_STORE_TEAM_ID: ${{ secrets.APP_STORE_TEAM_ID }}
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_PATH: fastlane/AuthKey.p8
SPACESHIP_CONNECT_API_IN_HOUSE: "false"
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
permissions:
contents: write
jobs:
release:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'develop'
runs-on: macos-latest
timeout-minutes: 45
steps:
- name: Checkout merge commit
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ env.RUBY_VERSION }}
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Write App Store Connect API key
env:
ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }}
run: |
printf '%s' "$ASC_KEY_CONTENT" | base64 -D > "$ASC_KEY_PATH"
- name: Debug ASC key fingerprint
run: |
shasum -a 256 "$ASC_KEY_PATH"
- name: Debug ASC metadata fingerprint
run: |
printf '%s' "$ASC_KEY_ID" | shasum -a 256
printf '%s' "$ASC_ISSUER_ID" | shasum -a 256
- name: Release to App Store Connect
run: bundle exec fastlane release
- name: Read release version
id: release_version
run: |
version=$(ruby -e 'project = File.read("DevLog.xcodeproj/project.pbxproj"); match = project.match(/MARKETING_VERSION = ([^;]+);/); abort("MARKETING_VERSION not found") if match.nil?; puts match[1]')
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=v$version" >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "${{ steps.release_version.outputs.tag }}" >/dev/null 2>&1; then
echo "Release already exists for ${{ steps.release_version.outputs.tag }}"
exit 0
fi
gh release create "${{ steps.release_version.outputs.tag }}" \
--target "${{ github.event.pull_request.merge_commit_sha }}" \
--title "${{ steps.release_version.outputs.tag }}" \
--generate-notes