-
-
Notifications
You must be signed in to change notification settings - Fork 9
95 lines (81 loc) · 3.12 KB
/
Copy path_build-release.yml
File metadata and controls
95 lines (81 loc) · 3.12 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
86
87
88
89
90
91
92
93
94
95
# Reusable workflow for building release artifacts
name: Build Release
on:
workflow_call:
inputs:
version:
description: Version number to build
required: true
type: string
commit-sha:
description: Commit SHA to build from
required: true
type: string
outputs:
artifact-name:
description: Name of the uploaded artifact
value: ${{ jobs.build.outputs.artifact-name }}
permissions:
contents: read
jobs:
build:
name: Build Release Artifact
runs-on: macos-latest
outputs:
artifact-name: ${{ steps.artifact.outputs.name }}
steps:
- name: Generate App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.RELEASER_APP_ID }}
private-key: ${{ secrets.RELEASER_APP_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ inputs.commit-sha }}
fetch-depth: 0
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: latest-stable
- name: Cache Swift Package Manager dependencies
uses: actions/cache@v4
with:
path: |
build/SourcePackages
build/.build
key: spm-${{ runner.os }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
spm-${{ runner.os }}-
- name: Build Release
uses: ./.github/actions/xcodebuild
with:
configuration: Release
derived-data-path: build
universal-binary: "true"
- name: Copy Third-Party Licenses
run: |
cp THIRD_PARTY_LICENSES build/Build/Products/Release/MiddleDrag.app/Contents/Resources/
- name: Create App Zip
id: artifact
run: |
VERSION="${{ inputs.version }}"
ARTIFACT_NAME="MiddleDrag-App-${VERSION}"
cd build/Build/Products/Release
zip -r -y "${GITHUB_WORKSPACE}/${ARTIFACT_NAME}.zip" MiddleDrag.app
echo "name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.name }}
path: ${{ steps.artifact.outputs.name }}.zip
retention-days: 1
- name: Upload dSYM Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.name }}-dSYM
path: build/Build/Products/Release/MiddleDrag.app.dSYM
retention-days: 1
if-no-files-found: warn