Release to SPM #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "mobileteam@deque.com" | |
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 |