name: Release

on:
  release:
    types: [released]

permissions: {}

jobs:
  publish-documentation:
    uses: ./.github/workflows/publish-documentation.yml
    secrets: inherit

  tests:
    uses: ./.github/workflows/tests.yml
  python-package:
    permissions:
      contents: write
    needs: tests
    uses: ./.github/workflows/python-package.yml
    secrets: inherit

  build-linux:
    uses: ./.github/workflows/build-linux.yml
  publish-linux:
    permissions:
      contents: write
    needs: build-linux
    uses: ./.github/workflows/publish-frozen-build.yml
    with:
      github_artifact: ${{ needs.build-linux.outputs.uploaded_artifact_name }}
      build_name: ${{ needs.build-linux.outputs.artifact_versioned_name }}
      build_alias: arelle-ubuntu.tgz
    secrets: inherit

  build-macos-x64:
    uses: ./.github/workflows/build-macos.yml
    with:
      macos_version: 13
      python_architecture: x64
    secrets: inherit
  publish-macos-x64:
    permissions:
      contents: write
    needs: build-macos-x64
    uses: ./.github/workflows/publish-frozen-build.yml
    with:
      github_artifact: ${{ needs.build-macos-x64.outputs.uploaded_artifact_name }}
      build_name: ${{ needs.build-macos-x64.outputs.artifact_versioned_name }}
      build_alias: arelle-macos-x64.dmg
    secrets: inherit

  build-macos-arm64:
    uses: ./.github/workflows/build-macos.yml
    with:
      macos_version: 15
      python_architecture: arm64
    secrets: inherit
  publish-macos-arm64:
    permissions:
      contents: write
    needs: build-macos-arm64
    uses: ./.github/workflows/publish-frozen-build.yml
    with:
      github_artifact: ${{ needs.build-macos-arm64.outputs.uploaded_artifact_name }}
      build_name: ${{ needs.build-macos-arm64.outputs.artifact_versioned_name }}
      build_alias: arelle-macos-arm64.dmg
    secrets: inherit

  build-windows:
    uses: ./.github/workflows/build-windows.yml
  publish-windows-installer:
    permissions:
      contents: write
    needs: build-windows
    uses: ./.github/workflows/publish-frozen-build.yml
    with:
      github_artifact: ${{ needs.build-windows.outputs.exe_uploaded_artifact_name }}
      build_name: ${{ needs.build-windows.outputs.exe_artifact_versioned_name }}
      build_alias: arelle-win.exe
    secrets: inherit
  publish-windows-zip:
    permissions:
      contents: write
    needs: build-windows
    uses: ./.github/workflows/publish-frozen-build.yml
    with:
      github_artifact: ${{ needs.build-windows.outputs.zip_uploaded_artifact_name }}
      build_name: ${{ needs.build-windows.outputs.zip_artifact_versioned_name }}
      build_alias: arelle-win.zip
    secrets: inherit
