-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
57 lines (48 loc) · 2.18 KB
/
action.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
name: 'Build DocC Static Site'
description: 'Build DocC Static Site'
inputs:
docC-generated-static-site-zipped-upload-name:
description: 'The upload name of sttaic site zipped artifact.'
required: true
default: 'docC_generated_site_zipped'
runs:
using: "composite"
steps:
- name: checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Prepare Building DocC
shell: bash
env:
DocC_Static_Site_Build_Ouptput_Path: ./docc_static_site
DocC_Derived_Data_Path_Build: ./.doc_build
run: |
mkdir $DocC_Derived_Data_Path_Build
mkdir $DocC_Static_Site_Build_Ouptput_Path
- name: Build DocC
shell: bash
env:
DocC_Static_Site_Build_Ouptput_Path: ./docc_static_site
DocC_Derived_Data_Path_Build: ./.doc_build
run: |
Package_Name=$(basename "$PWD")
DocC_Find_Executable_Path=$(xcrun --find docc)
xcodebuild docbuild -scheme $Package_Name -derivedDataPath $DocC_Derived_Data_Path_Build -destination 'platform=iOS Simulator,name=iPhone 13'
Docc_Generated_Archive_Path=$(find . -regex '.*/[^/]*.doccarchive')
$DocC_Find_Executable_Path process-archive transform-for-static-hosting $Docc_Generated_Archive_Path --output-path $DocC_Static_Site_Build_Ouptput_Path --hosting-base-path $Package_Name
- name: Archive DocC Generated Site Artifact
shell: bash
env:
DocC_Static_Site_Build_Ouptput_Path: ./docc_static_site
Zipped_Site_Output_Directory: ${{ runner.temp }}/${{ inputs.docC-generated-static-site-zipped-upload-name }}.tar
run: |
gtar --dereference --hard-dereference --directory $DocC_Static_Site_Build_Ouptput_Path -cvf $Zipped_Site_Output_Directory --exclude=.git --exclude=.github .
- name: Upload DocC Artifact
uses: actions/upload-artifact@main
with:
name: ${{ inputs.docC-generated-static-site-zipped-upload-name }}
path: ${{ runner.temp }}/${{ inputs.docC-generated-static-site-zipped-upload-name }}.tar
retention-days: 1
if-no-files-found: error