Release Skia static libraries #16
This file contains hidden or 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 Skia static libraries | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| prepare: | |
| name: Prepare release | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| skia_version: ${{ steps.version.outputs.skia_version }} | |
| tag_name: ${{ steps.version.outputs.tag_name }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| - name: Read Skia release metadata | |
| id: version | |
| run: | | |
| skia_version="$(python3 -c 'import json; print(json.load(open("skia/manifest.json"))["skia"]["commit"][:8])')" | |
| current_tag="$(python3 -c 'import json; print(json.load(open("skia/manifest.json"))["release"]["tag"])')" | |
| if [ -z "$skia_version" ] || [ -z "$current_tag" ]; then | |
| echo "Could not read Skia release metadata from skia/manifest.json" >&2 | |
| exit 1 | |
| fi | |
| if git ls-remote --exit-code --tags origin "refs/tags/${current_tag}" >/dev/null; then | |
| tag_name="$(.github/scripts/next-release-tag.sh skia "${skia_version}")" | |
| else | |
| tag_name="${current_tag}" | |
| fi | |
| if [ -z "$tag_name" ]; then | |
| echo "Could not read Skia release metadata from skia/manifest.json" >&2 | |
| exit 1 | |
| fi | |
| echo "skia_version=${skia_version}" >> "$GITHUB_OUTPUT" | |
| echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build release assets | |
| needs: prepare | |
| uses: ./.github/workflows/build-skia.yml | |
| release: | |
| name: Publish release | |
| needs: | |
| - prepare | |
| - build | |
| runs-on: ubuntu-24.04 | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| SKIA_VERSION: ${{ needs.prepare.outputs.skia_version }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download release assets | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: skia-release-assets | |
| path: release-assets | |
| - name: Update release metadata | |
| run: | | |
| current_tag="$(python3 -c 'import json; print(json.load(open("skia/manifest.json"))["release"]["tag"])')" | |
| if [ -z "$current_tag" ]; then | |
| echo "Could not read Skia release tag from skia/manifest.json" >&2 | |
| exit 1 | |
| fi | |
| if git ls-remote --exit-code --tags origin "refs/tags/${current_tag}" >/dev/null; then | |
| tag_name="$(.github/scripts/next-release-tag.sh skia "${SKIA_VERSION}")" | |
| else | |
| tag_name="${current_tag}" | |
| fi | |
| python3 .github/scripts/update-skia-release-tag.py "${tag_name}" | |
| echo "TAG_NAME=${tag_name}" >> "$GITHUB_ENV" | |
| - name: Commit release metadata | |
| run: | | |
| if git diff --quiet -- deps.yml skia/manifest.yml skia/manifest.json skia/artifacts.json skia/fetch.sh skia/cmake/AutoFetchSkia.cmake; then | |
| echo "Skia release metadata already points to ${TAG_NAME}" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add deps.yml skia/manifest.yml skia/manifest.json skia/artifacts.json skia/fetch.sh skia/cmake/AutoFetchSkia.cmake | |
| git commit -m "Update Skia release metadata to ${TAG_NAME}" | |
| git push origin "HEAD:${GITHUB_REF_NAME}" | |
| - name: Create release tag | |
| run: | | |
| if git ls-remote --exit-code --tags origin "refs/tags/${TAG_NAME}" >/dev/null; then | |
| echo "Tag ${TAG_NAME} already exists" >&2 | |
| exit 1 | |
| fi | |
| git tag -a "${TAG_NAME}" -m "Skia ${SKIA_VERSION}" | |
| git push origin "refs/tags/${TAG_NAME}" | |
| - name: Publish GitHub Release | |
| run: | | |
| mapfile -d '' release_files < <(find release-assets -maxdepth 1 -type f -print0 | sort -z) | |
| if [ "${#release_files[@]}" -eq 0 ]; then | |
| echo "No release asset files found under release-assets" >&2 | |
| exit 1 | |
| fi | |
| gh release create "${TAG_NAME}" "${release_files[@]}" \ | |
| --verify-tag \ | |
| --title "Skia ${SKIA_VERSION} static libraries" \ | |
| --notes "Static Skia ${SKIA_VERSION} libraries for TotalCross, including WebAssembly/WebGL wasm32, Android arm64-v8a with NDK ${ANDROID_NDK_VERSION:-28.2.13676358}, iOS device/simulator arm64 artifacts, and a separate diagnostics archive with full GN/Ninja logs." |