name: Release

# Tag-driven. Push a tag like v1.0.0 and the packager builds the zip, substitutes
# @project-version@ in the TOC, and uploads to whichever destinations have credentials.
on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

permissions:
  contents: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          # The packager builds the changelog from history, so it needs the full log.
          fetch-depth: 0

      - name: Package and publish
        uses: BigWigsMods/packager@master
        env:
          GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
          # Optional. Each upload is skipped unless its token is set, so you can enable
          # destinations one at a time without touching this file.
          CF_API_KEY: ${{ secrets.CF_API_KEY }}
          WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
          WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
