dir_spec 0.5.2

A cross-platform Rust library for resolving XDG and platform-specific directories with proper fallbacks.
Documentation
name: Release
permissions:
  actions: write
  contents: write
on:
  push:
    tags:
      - "[0-9]+.*"
jobs:
  wait-for-build:
    runs-on: ubuntu-latest
    steps:
      - name: Wait for Build workflow
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          sha="${{ github.sha }}"
          echo "Waiting for Build workflow to complete on $sha..."
          while true; do
            result=$(gh api "repos/${{ github.repository }}/actions/workflows/build.yml/runs" \
              --jq ".workflow_runs[] | select(.head_sha == \"$sha\") | .conclusion" | head -1)
            case "$result" in
              success) echo "Build passed"; exit 0 ;;
              failure|cancelled|timed_out) echo "Build $result"; exit 1 ;;
              *) echo "Build still running..."; sleep 30 ;;
            esac
          done
  create-release:
    needs: wait-for-build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: taiki-e/create-gh-release-action@v1
        with:
          changelog: CHANGELOG.md
          draft: true
          title: v$tag
          token: ${{ secrets.GITHUB_TOKEN }}
  publish-crate:
    needs:
      - create-release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: cargo publish
  publish-release:
    needs:
      - publish-crate
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Publish release
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: gh release edit "${{ github.ref_name }}" --draft=false
  notify-discord:
    needs: publish-release
    runs-on: ubuntu-latest
    steps:
      - name: Post to Discord
        env:
          DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
        run: |-
          curl -H "Content-Type: application/json" \
            -d "{\"content\": \"**dir_spec v${{ github.ref_name }}** has been released! https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}\"}" \
            "$DISCORD_WEBHOOK_URL"