|
| 1 | +# SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | +# Copyright (C) 2025 BeyondIRR <https://beyondirr.com/> |
| 3 | +# |
| 4 | +# This program is free software: you can redistribute it and/or modify |
| 5 | +# it under the terms of the GNU General Public License as published by |
| 6 | +# the Free Software Foundation, either version 3 of the License, or |
| 7 | +# (at your option) any later version. |
| 8 | +# |
| 9 | +# This program is distributed in the hope that it will be useful, |
| 10 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +# GNU General Public License for more details. |
| 13 | +# |
| 14 | +# You should have received a copy of the GNU General Public License |
| 15 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | + |
| 17 | +name: Release on Tag |
| 18 | + |
| 19 | +run-name: Release ${{ github.ref_name }} |
| 20 | + |
| 21 | +on: |
| 22 | + push: |
| 23 | + tags: |
| 24 | + - 'v*' |
| 25 | + |
| 26 | +permissions: |
| 27 | + contents: write |
| 28 | + |
| 29 | +jobs: |
| 30 | + build: |
| 31 | + name: Build with UV |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: Checkout code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: '3.12' |
| 41 | + |
| 42 | + - name: Install uv |
| 43 | + run: pip install uv |
| 44 | + |
| 45 | + - name: Build wheel and source distribution |
| 46 | + run: uv build |
| 47 | + |
| 48 | + - name: Upload build artifacts |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: dist-artifacts |
| 52 | + path: dist/* |
| 53 | + retention-days: 5 |
| 54 | + |
| 55 | + release: |
| 56 | + name: Create Release |
| 57 | + needs: build |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - name: Checkout code |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Download build artifacts |
| 64 | + uses: actions/download-artifact@v4 |
| 65 | + with: |
| 66 | + name: dist-artifacts |
| 67 | + path: dist/ |
| 68 | + |
| 69 | + - name: Extract tag name |
| 70 | + id: tag |
| 71 | + run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
| 72 | + |
| 73 | + - name: Create Draft Release |
| 74 | + uses: softprops/action-gh-release@v2 |
| 75 | + with: |
| 76 | + tag_name: ${{ steps.tag.outputs.tag }} |
| 77 | + name: Release ${{ steps.tag.outputs.tag }} |
| 78 | + draft: true |
| 79 | + files: dist/* |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments