diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..a44ce3a --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,72 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install build + run: pip install build + + - name: Build package + run: python -m build + + - name: Create Release + uses: https://gitea.com/actions/release-action@main + with: + files: | + dist/** + !dist/*.txt + !dist/*.md + draft: false + prerelease: false + name: Release ${{ github.ref_name }} + body: | + ## Changes + + See [CHANGELOG.md](CHANGELOG.md) for details. + + ## Installation + + ```bash + pip install gitignore-cli-generator==${{ github.ref_name }} + ``` + + release-pypi: + runs-on: ubuntu-latest + needs: release + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install build + run: pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}