-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.82 KB
/
upload-assets.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
name: Upload Assets
on:
release:
types: [published]
jobs:
xcframework:
name: Upload XCFramework Assets
runs-on: macOS-11
env:
TMPDIR: /tmp/.keyvalueobservation.assets-xcframework.build
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "${TMPDIR}/Output"
mkdir -p "${TMPDIR}/Logs"
- name: Build
run: |
./scripts/xcframework.sh --build-dir "${TMPDIR}" --output "${TMPDIR}/Output/KeyValueObservation.xcframework"
- name: Create Zip
run: |
cd "${TMPDIR}/Output"
zip -rX KeyValueObservation.xcframework.zip KeyValueObservation.xcframework 2>&1 | tee "${TMPDIR}/Logs/Zip.log"
- name: Upload Zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.TMPDIR }}/Output/KeyValueObservation.xcframework.zip
asset_name: KeyValueObservation.xcframework.zip
asset_content_type: application/zip
- name: Create Tar
run: |
cd "${TMPDIR}/Output"
tar -zcvf KeyValueObservation.xcframework.tar.gz KeyValueObservation.xcframework 2>&1 | tee "${TMPDIR}/Logs/Tar.log"
- name: Upload Tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.TMPDIR }}/Output/KeyValueObservation.xcframework.tar.gz
asset_name: KeyValueObservation.xcframework.tar.gz
asset_content_type: application/gzip
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: XCFrameworkLogs
path: ${{ env.TMPDIR }}/Logs/*.log