Skip to content

🐍 Refresh NCurses #10

🐍 Refresh NCurses

🐍 Refresh NCurses #10

Workflow file for this run

name: 🐍 Refresh NCurses
on:
workflow_dispatch:
schedule:
- cron: "0 9 1 1-12 *"
jobs:
ubuntu:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.os }}
name: 🐧 Ubuntu (${{ matrix.arch }})
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: mirror/ncurses
ref: refs/heads/master
- name: 🛠️ Build library
id: build-library
run: |
./configure \
--prefix=/usr \
--enable-pc-files \
--without-cxx \
--without-ada \
--enable-widec \
--with-pkg-config-libdir=/usr/lib/pkgconfig \
--with-shared \
--enable-sigwinch \
--with-versioned-syms \
--with-xterm-kbs=del \
--enable-warnings \
--enable-assertions \
--disable-macros \
--without-manpages
make
mv lib/libncursesw.so lib/libncursesw-${{ matrix.arch }}.so
- name: ⬆️ Upload artifacts
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: libraries-ubuntu-${{ matrix.arch }}-vt
path: "lib/libncursesw-${{ matrix.arch }}.so"
if-no-files-found: error
macos:
strategy:
matrix:
include:
- os: macos-15-intel
arch: x64
- os: macos-15
arch: arm64
runs-on: ${{ matrix.os }}
name: 🍎 macOS (${{ matrix.arch }})
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: mirror/ncurses
ref: refs/heads/master
- name: 🛠️ Build library
id: build-library
run: |
./configure \
--prefix=/usr \
--enable-pc-files \
--without-cxx \
--without-ada \
--enable-widec \
--with-pkg-config-libdir=/usr/lib/pkgconfig \
--with-shared \
--enable-sigwinch \
--with-versioned-syms \
--with-xterm-kbs=del \
--enable-warnings \
--enable-assertions \
--disable-macros \
--without-manpages \
--with-gpm=no
make
mv lib/libncursesw.dylib lib/libncursesw-${{ matrix.arch }}.dylib
- name: ⬆️ Upload artifacts
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: libraries-macos-${{ matrix.arch }}-vt
path: "lib/libncursesw-${{ matrix.arch }}.dylib"
if-no-files-found: error
windows-x64:
name: 🪟 Windows (x64)
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: mirror/ncurses
ref: refs/heads/master
- name: ⚙️ Setup environment
id: setup-environment
uses: msys2/setup-msys2@v2
with:
install: gcc make diffutils msys2-w32api-headers msys2-w32api-runtime
- name: 🛠️ Build library
id: build-library
run: |
./configure \
--prefix=/mingw64 \
--without-cxx \
--without-ada \
--enable-warnings \
--enable-assertions \
--enable-exp-win32 \
--enable-ext-funcs \
--disable-home-terminfo \
--disable-echo \
--disable-getcap \
--disable-hard-tabs \
--disable-leaks \
--disable-macros \
--disable-overwrite \
--enable-opaque-curses \
--enable-opaque-panel \
--enable-opaque-menu \
--enable-interop \
--enable-exp-win32 \
--enable-database \
--with-progs \
--without-libtool \
--enable-pc-files \
--with-shared \
--with-normal \
--without-debug \
--enable-widec \
--with-fallbacks=ms-terminal \
--without-manpages
make
mv lib/libncursesw6.dll lib/libncursesw-x64.dll
- name: ⬆️ Upload artifacts
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: libraries-windows-x64-vt
path: "lib/libncursesw-x64.dll"
if-no-files-found: error
create-pr:
name: 📝 Create pull request
runs-on: ubuntu-latest
needs:
[ubuntu, macos, windows-x64]
outputs:
pr_created: ${{ steps.create-pull-request.outputs.pull-request-number != '' }}
pr_number: ${{ steps.create-pull-request.outputs.pull-request-number }}
files_changed: ${{ steps.check-changes.outputs.files_changed }}
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@v4
- name: 📥 Download artifacts
id: download-artifact
uses: actions/download-artifact@v4.1.7
with:
pattern: libraries*
merge-multiple: true
path: lib/ncurses
- name: 🔍 Check for changes
id: check-changes
run: |
if git diff --quiet HEAD -- lib/ncurses/; then
echo "files_changed=false" >> $GITHUB_OUTPUT
else
echo "files_changed=true" >> $GITHUB_OUTPUT
fi
- name: 🔼 Bump version
id: bump-version
if: steps.check-changes.outputs.files_changed == 'true'
run: |
VERSION=$(date +%Y.%m.%d)
sed -i "s|<OverallVersion>.*</OverallVersion>|<OverallVersion>$VERSION</OverallVersion>|" NativeLibraries/Sharpie.NativeLibraries.NCurses.csproj
- name: 📝 Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@v6
with:
commit-message: (chore) Update NCurses native libraries.
committer: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
author: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
title: Update NCurses native library to latest master.
body: This is an auto-generated PR with native library updates.
delete-branch: true
labels: dependencies
assignees: pavkam
branch: ncurses-lib-update
summary:
name: ✔︎ Generate summary
runs-on: ubuntu-latest
needs: [ubuntu, macos, windows-x64, create-pr]
if: always()
steps:
- name: 📝 Create summary
id: create-summary
shell: bash
run: |
echo "## 🐍 NCurses Library Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status | Library Changes |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|----------------|" >> $GITHUB_STEP_SUMMARY
# Check each build job status
if [ "${{ needs.ubuntu.result }}" = "success" ]; then
echo "| Ubuntu | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Ubuntu | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.macos.result }}" = "success" ]; then
echo "| macOS | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| macOS | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.windows-x64.result }}" = "success" ]; then
echo "| Windows x64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Windows x64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📝 Pull Request Status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Check if PR was created and files changed
if [ "${{ needs.create-pr.outputs.pr_created }}" = "true" ]; then
if [ "${{ needs.create-pr.outputs.files_changed }}" = "true" ]; then
echo "| Status | 🔄 PR Created with Changes |" >> $GITHUB_STEP_SUMMARY
echo "| PR Number | #${{ needs.create-pr.outputs.pr_number }} |" >> $GITHUB_STEP_SUMMARY
else
echo "| Status | ⏭️ No Changes - No PR Created |" >> $GITHUB_STEP_SUMMARY
fi
else
echo "| Status | ❌ PR Creation Failed |" >> $GITHUB_STEP_SUMMARY
fi