Skip to content

Build and Publish GH+PyPi #50

Build and Publish GH+PyPi

Build and Publish GH+PyPi #50

Workflow file for this run

name: Build and Publish
on:
workflow_dispatch:
permissions:
contents: write
discussions: write
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
Release:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
- name: Create list of .whl files
run: |
python -c "
with open('filelist.txt', 'r') as f:
files = f.readlines()
formatted_files = ''.join([file.strip() + '\n' for file in files])
print(formatted_files)
with open('formatted_filelist.txt', 'w') as f:
f.write(formatted_files)
"
- name: Set FILE_LIST env variable
run: echo "FILE_LIST=$(cat formatted_filelist.txt)" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body: |
Please read the [CHANGELOG](https://github.com/LUCIT-Systems-and-Development/lucit-licensing-python/blob/main/CHANGELOG.md) for further information.
discussion_category_name: releases
draft: false
files: |
${{ env.FILE_LIST }}
generate_release_notes: true
name: lucit-licensing-python
prerelease: false
tag_name: 1.0.29
token: ${{ secrets.RELEASE_TOKEN }}