Version 2.5.0rc0 #65
Workflow file for this run
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: Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
publish-pypi: | |
type: boolean | |
description: Publish to PyPI | |
release: | |
types: | |
- published | |
jobs: | |
determine-source-date-epoch: | |
name: "Determine SOURCE_DATE_EPOCH" | |
runs-on: ubuntu-latest | |
outputs: | |
source-date-epoch: ${{ steps.log.outputs.source-date-epoch }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- id: log | |
name: Compute SOURCE_DATE_EPOCH | |
run: | | |
# Find latest unix timestamp in awkward-cpp, and the kernel generation files | |
epoch=$( git log -1 --format=%at -- awkward-cpp kernel-specification.yml kernel-test-data.json ) | |
echo "source-date-epoch=$epoch" >> $GITHUB_OUTPUT | |
check-requirements: | |
name: "Check awkward requirements" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Check awkward-cpp version matches requirement | |
run: pipx run nox -s check_cpp_constraint | |
check-cpp-on-pypi: | |
name: "Check awkward-cpp dependency on PyPI" | |
runs-on: ubuntu-latest | |
needs: [determine-source-date-epoch] | |
env: | |
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare build files | |
run: pipx run nox -s prepare | |
- name: Build awkward-cpp sdist | |
run: pipx run build --sdist awkward-cpp | |
- name: Check sdist matches PyPI | |
run: pipx run nox -s check_cpp_sdist_released -- awkward-cpp/dist/awkward-cpp*.tar.gz | |
build: | |
name: "Build wheel & sdist" | |
runs-on: ubuntu-latest | |
needs: [determine-source-date-epoch] | |
env: | |
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare build files | |
run: pipx run nox -s prepare | |
- name: Build distributions | |
run: pipx run build --sdist --wheel | |
- name: Check metadata | |
run: pipx run twine check dist/* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: distributions | |
path: dist/* | |
bundle-headers: | |
name: "Bundle header-only libraries" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: header-only | |
path: header-only | |
upload: | |
needs: [build, check-requirements, check-cpp-on-pypi] | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'release' && github.event.action == 'published') || inputs.publish-pypi | |
permissions: | |
id-token: write | |
environment: | |
name: "pypi" | |
url: "https://pypi.org/project/awkward/" | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: distributions | |
path: dist | |
- uses: pypa/[email protected] | |
publish-headers: | |
name: "Publish header-only libraries alongside release" | |
runs-on: ubuntu-latest | |
needs: [bundle-headers] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: header-only | |
path: header-only | |
- name: Create archive | |
run: | | |
# Don't include `header-only` parent directory | |
env -C header-only/ zip -r header-only.zip . | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: header-only/header-only.zip |