tadashi-aikawa/jumeaux

View on GitHub
.github/workflows/release.yaml

Summary

Maintainability
Test Coverage
name: "Release"

on:
  workflow_dispatch:
    inputs:
      version:
        description: "Release version (ex: 2.3.1)"
        required: true

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install Poetry
        run: |
          python -m pip install --upgrade pip poetry --pre
          poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
      - run: |
          git config user.email "github-actions@users.noreply.github.com"
          git config user.name "GitHub Actions"

      - name: Release
        run: make release version=${{ github.event.inputs.version }}
        env:
          TZ: "Asia/Tokyo"

      - name: "Discord notification (not success)"
        uses: rjstone/discord-webhook-notify@v1
        if: "! success()"
        with:
          description: "⚠ Jumeaux Release failed!"
          details: "${{ github.event.inputs.version }}"
          severity: error
          avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

  notify:
    needs: release
    runs-on: ubuntu-latest

    steps:
      - name: "Discord notification (success)"
        uses: rjstone/discord-webhook-notify@v1
        if: always()
        with:
          description: "✅ Jumeaux Release finished!"
          details: "${{ github.event.inputs.version }}"
          severity: info
          avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}