tildagon 0.0.2

Board support crate for the Electromagnetic Field Tildagon badge
name: Release-plz

permissions:
  pull-requests: write
  contents: write

on:
  push:
    branches:
      - main

jobs:
  # Release unpublished packages.
  release-plz-release:
    name: Release-plz release
    runs-on: ubuntu-latest
    if: ${{ github.repository_owner == 'DanNixon' }}

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
      - uses: cachix/install-nix-action@v31
      - uses: cachix/cachix-action@v16
        with:
          name: devenv
      - name: Install devenv.sh
        run: nix profile install nixpkgs#devenv

      - name: Install toolchain
        shell: devenv shell bash -- -e {0}
        run: espup install

      - name: Configure git user from GitHub token
        uses: release-plz/git-config@v0.1.2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Run release-plz
        shell: devenv shell bash -- -e {0}
        run: |
          source ./.export-esp.sh
          release-plz release --forge=github
        env:
          GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  # Create a PR with the new versions and changelog, preparing the next release.
  release-plz-pr:
    name: Release-plz PR
    runs-on: ubuntu-latest
    if: ${{ github.repository_owner == 'DanNixon' }}

    permissions:
      contents: write
      pull-requests: write

    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false

    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
      - uses: cachix/install-nix-action@v31
      - uses: cachix/cachix-action@v16
        with:
          name: devenv
      - name: Install devenv.sh
        run: nix profile install nixpkgs#devenv

      - name: Install toolchain
        shell: devenv shell bash -- -e {0}
        run: espup install

      - name: Run release-plz
        shell: devenv shell bash -- -e {0}
        run: |
          source ./.export-esp.sh
          release-plz release-pr --forge=github
        env:
          GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}