Merge pull request #90 from tiyeuse/master #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
branches: [master] | |
push: | |
branches: [master] | |
paths: | |
- 'VERSION' | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
linux-build: | |
name: Linux Build | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: PDM | |
run: python3.12 -m pip install pdm | |
- name: Install libkrb5-dev | |
run: sudo apt-get install -y libkrb5-dev | |
- name: Installs dev deps and package | |
run : PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev | |
- name: Build binary release | |
run: | | |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py | |
mv ldeep.bin ldeep_linux-amd64 | |
- name: Build Source Distribution | |
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm build -d sdist --no-wheel | |
- name: Upload Artifacts (binary) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: ldeep_linux-amd64 | |
- name: Upload Artifacts (sdist) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: sdist/* | |
windows-build: | |
name: Windows Build | |
runs-on: "windows-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: PDM | |
run: python3 -m pip install pdm | |
- name: Installs dev deps and package | |
run: $env:PDM_BUILD_SCM_VERSION=gc "VERSION"; pdm install --dev | |
- name: Build | |
run: | | |
pdm run python3 -m nuitka --standalone --assume-yes-for-downloads --output-filename=ldeep.exe --onefile ldeep/__main__.py | |
mv ldeep.exe ldeep_windows-amd64.exe | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: ldeep_windows-amd64.exe | |
macos-build: | |
name: MacOS ARM64 Build | |
runs-on: "macos-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: PDM | |
run: python3.12 -m pip install pdm | |
- name: Installs dev deps and package | |
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev | |
- name: Build | |
run: | | |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py | |
mv ldeep.bin ldeep_macos-arm64 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos | |
path: ldeep_macos-arm64 | |
macos-amd-build: | |
name: MacOS AMD64 Build | |
runs-on: "macos-13" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: PDM | |
run: python3.12 -m pip install pdm | |
- name: Installs dev deps and package | |
run: PDM_BUILD_SCM_VERSION=$(cat VERSION) pdm install --dev | |
- name: Build | |
run: | | |
pdm run python3.12 -m nuitka --standalone --onefile --output-filename=ldeep.bin ldeep/__main__.py | |
mv ldeep.bin ldeep_macos-amd64 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-amd | |
path: ldeep_macos-amd64 | |
tagged-release: | |
needs: [linux-build, windows-build, macos-build, macos-amd-build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get local version | |
run: echo "version=$(cat VERSION)" >> $GITHUB_ENV | |
- name: Create tag | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: ${{ env.version }} | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create the release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.version }} | |
generate_release_notes: true | |
body: "${{ github.event.head_commit.message }}" | |
files: | | |
linux/ldeep_linux-amd64 | |
windows/ldeep_windows-amd64.exe | |
macos/ldeep_macos-arm64 | |
macos-amd/ldeep_macos-amd64 | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: sdist/ |