diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 064cd3f..4c6467c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,47 @@ name: CI on: - pull_request: - branches: - - main push: - branches: - - main + tags: + - "*.*.*" jobs: build: + name: Build Release runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.PAT }} steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: "3.10" - - uses: Gr1N/setup-poetry@v8 - - run: poetry build --format=wheel -vvv + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y + + - name: Update PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Build project for distribution + run: poetry build + + - name: Check Version + id: check-version + run: | + [[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT + - id: changelog uses: heinrichreimer/github-changelog-generator-action@v2.3 with: token: ${{ secrets.PAT }} - - id: create-release - uses: actions/create-release@v1 + + - name: Create Release + uses: ncipollo/release-action@v1 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + token: ${{ secrets.PAT }} + artifacts: "dist/*" + draft: false + prerelease: steps.check-version.outputs.prerelease == 'true' + generateReleaseNotes: true body: ${{ steps.changelog.outputs.changelog }} - prerelease: true - - id: upload-release-asset - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: dist/*.whl - asset_name: ${{ github.event.repository.name }}-${{ github.ref }}.whl - asset_content_type: application/zip