Skip to content

build(deps): bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 #804

build(deps): bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3

build(deps): bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 #804

Workflow file for this run

name: ci
on:
push:
paths-ignore:
- "**.md"
- "**.rst"
- "**.ipynb"
- "docs/**"
- ".readthedocs.yaml"
pull_request:
paths-ignore:
- "**.md"
- "**.rst"
- "**.ipynb"
- "docs/**"
- ".readthedocs.yaml"
release:
types:
- published
env:
buildDir: "${{ github.workspace }}/build/"
NWN_ROOT: "${{ github.workspace }}/nwn/"
CI_GITHUB_ACTIONS: "1"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13, ubuntu-20.04, windows-2019]
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }}
steps:
- name: Get current date
if: matrix.os != 'windows-2019'
run: |
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get current date
if: matrix.os == 'windows-2019'
run: |
echo "DATE=$(Get-Date -Format yyyy-MM-dd)" | Out-File -FilePath $env:GITHUB_ENV -Append
# Windows dependencies
- name: windows - install dependencies
if: matrix.os == 'windows-2019'
run: |
choco upgrade ccache ninja
# macOS Dependencies
- name: macOS - install dependencies
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
env:
HOMEBREW_NO_ANALYTICS: "ON"
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
run: |
rm /usr/local/bin/2to3
rm /usr/local/bin/2to3-3.11
rm /usr/local/bin/idle3
rm /usr/local/bin/idle3.11
rm /usr/local/bin/pydoc3
rm /usr/local/bin/pydoc3.11
rm /usr/local/bin/python3
rm /usr/local/bin/python3-config
rm /usr/local/bin/python3.11
rm /usr/local/bin/python3.11-config
brew install --force --overwrite pkg-config automake ninja libtool zlib ccache
# Linux dependencies
- name: linux - install gcc
if: ${{ runner.os == 'Linux' }}
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11 ccache
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
- uses: actions/checkout@v4
with:
submodules: true
# Install latest CMake.
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.29.4
- name: all - cache ccache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.ccache/
key: ${{ matrix.os }}-ccache-${{ env.DATE }}
restore-keys: |
${{ matrix.os }}-ccache-
# nwn
- name: all - cache nwn
id: cache-nwn
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/nwn/
key: cache-nwn-3e02cddcea5d0ae82111a3038f14aef6c14d05d9
- name: all - download nwn
if: steps.cache-nwn.outputs.cache-hit != 'true'
run: |
curl https://nwn.beamdog.net/downloads/nwnee-dedicated-8193.34.zip -O
unzip nwnee-dedicated-8193.34.zip -d ${{ github.workspace }}/nwn/
ls -l ${{ github.workspace }}/nwn/
# build the normal libraries
- name: windows - Visual Studio shell
if: matrix.os == 'windows-2019'
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: setup ccache
run: |
ccache --set-config=cache_dir=${{ github.workspace }}/.ccache
ccache --set-config=max_size=5G
ccache --set-config=compression=true
- name: ccache - setenv
if: ${{ runner.os != 'Windows' }}
run: |
env
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
HOST_CCACHE_DIR="$(ccache -k cache_dir)"
mkdir -p $HOST_CCACHE_DIR
- name: ccache - setenv
if: ${{ runner.os == 'Windows' }}
run: |
$env:HOST_CCACHE_DIR="$(ccache -k cache_dir)"
md $env:HOST_CCACHE_DIR -ea 0
- name: windows - configure
if: matrix.os == 'windows-2019'
run: |
cmake --preset ci-windows
- name: macOS - configure
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
cmake --preset ci-macos
- name: linux - configure
if: matrix.os == 'ubuntu-20.04'
run: |
cmake --preset ci-linux
- name: all - build & test
run: |
cmake --build --preset default
ctest --preset default
- name: upload tests
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-build-${{matrix.os}}
path: "${{ github.workspace }}/build/tests"
- name: Build wheels
uses: pypa/[email protected]
- name: Download Cache from Docker (linux only)
if: ${{ runner.os == 'Linux' }}
run: |
env
ccache -s
HOST_CCACHE_DIR="$(ccache -k cache_dir)"
rm -rf $HOST_CCACHE_DIR
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- uses: actions/upload-artifact@v4
with:
name: artifact-${{matrix.os}}
path: ./wheelhouse/*.whl
- name: ccache stats
run: |
ccache -s
build_sdist:
name: Build source distribution
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: SDist
path: dist/*.tar.gz
upload_pypi:
needs: [build, build_sdist]
runs-on: ubuntu-20.04
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
path: all
- name: Merge files
run: |
mkdir dist
mv all/*/* dist/.
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}