-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (75 loc) · 3.49 KB
/
spm-release.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release to SPM
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'The version/tag of the release'
required: true
commitHash:
description: 'The commit hash if included in Agora filename'
required: false
jobs:
update_spm:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Remove existing framework and docs
run: |
rm -rf axeDevToolsXCUI.*
- name: Download latest XCUI framework & DocC archive
env:
DQ_AGORA_KEY: ${{ secrets.DQ_AGORA_KEY }}
run: |
VERSION_NUM=${{ github.event.inputs.releaseVersion }}
COMMIT_HASH=${{ github.event.inputs.commitHash }}
BASE_URL="https://agora.dequecloud.com/artifactory/Attest-iOS/axeDevToolsXCUI"
FRAMEWORK_FILENAME="axeDevToolsXCUI.xcframework-${VERSION_NUM}"
DOCS_FILENAME="axeDevToolsXCUI.doccarchive-${VERSION_NUM}"
if [ -n "$COMMIT_HASH" ]; then
FRAMEWORK_FILENAME="${FRAMEWORK_FILENAME}-${COMMIT_HASH}"
DOCS_FILENAME="${DOCS_FILENAME}-${COMMIT_HASH}"
fi
FRAMEWORK_URL="${BASE_URL}/frameworks/${FRAMEWORK_FILENAME}.zip"
DOCS_URL="${BASE_URL}/docs/${DOCS_FILENAME}.zip"
LOCAL_ZIPPED_FRAMEWORK_URL="${FRAMEWORK_FILENAME}.zip"
LOCAL_ZIPPED_DOCS_URL="${DOCS_FILENAME}.zip"
# Download framework & docs
curl -f -H "X-JFrog-Art-Api:${DQ_AGORA_KEY}" -o $LOCAL_ZIPPED_FRAMEWORK_URL $FRAMEWORK_URL
curl -f -H "X-JFrog-Art-Api:${DQ_AGORA_KEY}" -o $LOCAL_ZIPPED_DOCS_URL $DOCS_URL
# Unzip framework & docs
unzip -o ${LOCAL_ZIPPED_FRAMEWORK_URL} -d .
unzip -o $LOCAL_ZIPPED_DOCS_URL -d .
ls -al .
- name: Remove Zipped Files
run: |
rm -rf *.zip
- name: Verify Files Exist
run: |
if [[ -f "Package.swift" && -d "axeDevToolsXCUI.doccarchive" && -d "axeDevToolsXCUI.xcframework" ]]; then
echo "All required files and directories are present."
else
echo "One or more required files/directories are missing."
exit 1
fi
- name: Commit changes
run: |
git config user.name "deque-mobileteam"
git config user.email "[email protected]"
git add axeDevToolsXCUI.*
git commit -m "chore: release ${{ github.event.inputs.releaseVersion }}"
git status
# - name: Create and push tag
# run: |
# git tag -a ${{ github.event.inputs.releaseVersion }} -m "Release ${{ github.event.inputs.releaseVersion }}"
# git push origin tag ${{ github.event.inputs.releaseVersion }}
# - name: Create GitHub release
# uses: softprops/action-gh-release@v2
# with:
# tag_name: ${{ github.event.inputs.releaseVersion }}
# release_name: ${{ github.event.inputs.releaseVersion }}
# generate_release_notes: true
# draft: false
# prerelease: false