Skip to content

Add job to deploy docs to gh pages in release workflow #31

Add job to deploy docs to gh pages in release workflow

Add job to deploy docs to gh pages in release workflow #31

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

(Line: 147, Col: 12): Job 'deploy-docs' depends on unknown job 'release-docs'.
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
jobs:
release:
permissions:
contents: write
runs-on: macOS-15
steps:
- uses: actions/checkout@v4
- name: Get Version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Verify Version
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
PLUGIN_VERSION=$(./gradlew -q getVersion)
if [[ $PLUGIN_VERSION = $VERSION ]]; then exit 0 ; else exit 1; fi
- name: Get the release notes
id: get_release_notes
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
delimiter="$(openssl rand -hex 8)"
{
echo "NOTES<<${delimiter}"
awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md
echo ${delimiter}
} >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
dotnet-version: |
10.0.x
- name: Restore workloads
run: |
dotnet workload install android ios maui-android maui-ios maui-maccatalyst
- name: Download iOS SDK xcframeworks
env:
GH_TOKEN: ${{ secrets.CARTHAGE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: |
# Get iOS SDK version from airship.properties
IOS_VERSION=$(grep '^iosVersion' airship.properties | cut -d'=' -f2 | tr -d ' ')
echo "Downloading Airship iOS SDK xcframeworks version $IOS_VERSION"
# Download the .NET-specific xcframeworks (no visionOS, smaller package size)
gh release download "$IOS_VERSION" \
--repo urbanairship/ios-library \
--pattern "Airship.dotnet.xcframeworks.zip" \
--output Airship.dotnet.xcframeworks.zip
# Extract to Carthage/Build to maintain compatibility with project paths
mkdir -p Carthage/Build
unzip -q Airship.dotnet.xcframeworks.zip
mv xcframeworks/*.xcframework Carthage/Build/
rm -rf xcframeworks Airship.dotnet.xcframeworks.zip
# Verify frameworks exist
echo "Downloaded xcframeworks:"
ls -la Carthage/Build/
- name: Build AirshipWrapper
run: |
# Debug: Show current directory and AirshipWrapper contents
echo "Current directory: $(pwd)"
echo "AirshipWrapper directory contents:"
ls -la AirshipWrapper/
# Run build-wrapper.sh from root directory to maintain correct relative paths
cd AirshipWrapper && ./build-wrapper.sh && cd ..
# Debug: Show what was built
echo "Contents after build:"
ls -la AirshipWrapper/
if [ -d "AirshipWrapper/lib" ]; then
echo "lib directory contents:"
ls -la AirshipWrapper/lib/
else
echo "lib directory not found"
fi
# Verify the framework was built
if [ ! -d "AirshipWrapper/lib/AirshipWrapper.xcframework" ]; then
echo "ERROR: AirshipWrapper.xcframework not found after build!"
echo "Build may have failed. Check the build output above."
exit 1
fi
# Copy the built wrapper to the binding project
mkdir -p src/AirshipBindings.iOS.ObjectiveC/lib
cp -R AirshipWrapper/lib/AirshipWrapper.xcframework src/AirshipBindings.iOS.ObjectiveC/lib/
- name: Install doc dependencies
run: |
brew install doxygen
brew install graphviz
- name: Build and Publish Nugets
env:
NUGET_PRODUCTION_API_KEY: ${{ secrets.NUGET_PRODUCTION_API_KEY }}
run: ./gradlew build pack packageDocs publishToProduction --warning-mode=summary --no-parallel
- name: Create Github Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
deploy-docs:
needs: release-docs
runs-on: ubuntu-latest
continue-on-error: true # Remove when migration to GH Pages is complete
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4