diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 367b0bb..d22125e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,50 +1,48 @@ - -name: Create Release - on: push: - # Sequence of patterns matched against refs/tags tags: - - '[0-9]+.[0-9]+.[0-9]+' # Exclude pre-releases + - '*' + +name: Create Release jobs: - build: - runs-on: ubuntu-latest - - steps: - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: lvmpwi ${{ github.ref }} - body: "" - draft: false - prerelease: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - # python -m pip install --upgrade pip toml setuptools wheel twine - python -m pip install --upgrade pip toml setuptools wheel twine build - - - name: Build package - run: | - # python setup.py sdist - python -m build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + build: + name: Build wheels + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.12'] + + permissions: + contents: write + id-token: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + name: lvmpwi ${{ github.ref_name }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel build + + - name: Build wheels + run: | + pyproject-build -w + + - name: Build source + run: | + pyproject-build -s + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1