-
-
Notifications
You must be signed in to change notification settings - Fork 16
Create distribution packages for ubuntu (.deb release v0.0.1) #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nciric
merged 9 commits into
unicode-org:main
from
dockerh:release/ubuntu-packaging-v0.0.1
Jul 14, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a22316b
Github workflow for Ubuntu Packaging
dockerh fde11ea
Github workflow for Ubuntu Packaging.
dockerh c3864d6
Github workflow for Ubuntu Packaging!
dockerh 6421ce9
Refactor packaging workflow based on the feedback
dockerh 8a8fa41
Fix CPack versioning: derive major/minor/patch from INFLECTION_VERSION
dockerh a5800f8
Fixing Version Issue
dockerh c9ae1f4
Fixing the Cmake Version
dockerh 67ba8aa
Fix: Cpack Version Handling
dockerh a45eb4d
Add CPack-based Ubuntu packaging and GitHub Actions release workflow
dockerh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
103 changes: 103 additions & 0 deletions
103
.github/workflows/create-ubuntu-distribution-packaging.yml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# ---------------------------------------------------------------------------------------- | ||
# To update ICU version: | ||
# 1. Update the ICU_VERSION environment variable below. | ||
# 2. Check the ICU binary URL — is the filename still Ubuntu22.04-x64.tgz? | ||
# (e.g., icu4c-78_1-Ubuntu22.04-x64.tgz) | ||
# 3. Update inflection/CMakeLists.txt: | ||
# - Modify `CPACK_DEBIAN_PACKAGE_DEPENDS` to match the new ICU version. | ||
# ---------------------------------------------------------------------------------------- | ||
|
||
name: Build & Package (Ubuntu) | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-package: | ||
runs-on: ubuntu-latest | ||
env: | ||
ICU_VERSION: 77_1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Setup Git LFS | ||
run: | | ||
git lfs install | ||
git lfs pull | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y cmake build-essential clang pkg-config | ||
|
||
- name: Cache ICU | ||
uses: actions/cache@v4 | ||
id: cache-icu | ||
with: | ||
path: /usr/local | ||
key: icu-${{ env.ICU_VERSION }}-ubuntu-${{ runner.os }} | ||
|
||
- name: Install ICU (Binary) | ||
if: steps.cache-icu.outputs.cache-hit != 'true' | ||
run: | | ||
cd /tmp | ||
wget https://github.com/unicode-org/icu/releases/download/release-${ICU_VERSION//_/-}/icu4c-${ICU_VERSION}-Ubuntu22.04-x64.tgz | ||
mkdir icu-install | ||
tar -xzf icu4c-${ICU_VERSION}-Ubuntu22.04-x64.tgz -C icu-install | ||
sudo cp -r icu-install/icu/usr/local/* /usr/local/ | ||
sudo ldconfig | ||
|
||
- name: Setup ICU (from cache) | ||
if: steps.cache-icu.outputs.cache-hit == 'true' | ||
run: | | ||
sudo ldconfig | ||
|
||
- name: Configure & Build | ||
run: | | ||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH | ||
export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH | ||
mkdir -p inflection/build | ||
cd inflection/build | ||
CC=clang CXX=clang++ cmake .. \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DICU_ROOT=/usr/local \ | ||
-DCMAKE_PREFIX_PATH=/usr/local | ||
make -j$(nproc) | ||
|
||
- name: Run tests | ||
run: | | ||
cd inflection/build | ||
make -j$(nproc) check | ||
|
||
- name: Package with CPack | ||
run: | | ||
cd inflection/build | ||
cpack | ||
ls -la *.deb *.tar.gz | ||
|
||
- name: Upload release artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ubuntu-release-artifacts | ||
path: | | ||
inflection/build/*.deb | ||
inflection/build/*.tar.gz | ||
retention-days: 30 | ||
|
||
- name: Upload to GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
name: "Release ${{ github.ref_name }}" | ||
files: | | ||
inflection/build/*.deb | ||
inflection/build/*.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,51 @@ make generate-coverage-csv : Generates code coverage as a csv\\n\ | |
install(TARGETS inflection LIBRARY COMPONENT inflection_library) | ||
install(DIRECTORY ${INFLECTION_INCLUDE_ROOT}/ TYPE INCLUDE COMPONENT inflection_headers) | ||
install(DIRECTORY ${INFLECTION_DATA_ROOT}/ TYPE DATA COMPONENT inflection_data) | ||
|
||
|
||
|
||
# CPack Configuration for Ubuntu Packaging | ||
|
||
set(CPACK_PACKAGE_NAME "unicode-inflection") | ||
|
||
# Apply the current tagged Inflection version to the CPack version. | ||
# CPack may inherit a default or cached version, so we explicitly set it here. | ||
set(CPACK_PACKAGE_VERSION "${INFLECTION_VERSION}") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put a comment here:
|
||
string(REPLACE "." ";" INFLECTION_VERSION_LIST "${INFLECTION_VERSION}") | ||
|
||
# Set defaults to avoid list index errors | ||
set(CPACK_PACKAGE_VERSION_MAJOR "0") | ||
set(CPACK_PACKAGE_VERSION_MINOR "0") | ||
set(CPACK_PACKAGE_VERSION_PATCH "0") | ||
|
||
list(LENGTH INFLECTION_VERSION_LIST _len) | ||
if(_len GREATER 0) | ||
list(GET INFLECTION_VERSION_LIST 0 CPACK_PACKAGE_VERSION_MAJOR) | ||
endif() | ||
if(_len GREATER 1) | ||
list(GET INFLECTION_VERSION_LIST 1 CPACK_PACKAGE_VERSION_MINOR) | ||
endif() | ||
if(_len GREATER 2) | ||
list(GET INFLECTION_VERSION_LIST 2 CPACK_PACKAGE_VERSION_PATCH) | ||
endif() | ||
|
||
set(CPACK_PACKAGE_VENDOR "Unicode Consortium") | ||
set(CPACK_PACKAGE_CONTACT "https://github.com/unicode-org/inflection") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Unicode Inflection Library") | ||
set(CPACK_GENERATOR "DEB;TGZ") | ||
|
||
# DEB-specific options | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unicode Consortium <[email protected]>") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libicu77 (>= 77.1)") | ||
set(CPACK_DEBIAN_PACKAGE_SECTION "libs") | ||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") | ||
set(CPACK_DEBIAN_PACKAGE_VERSION "${INFLECTION_VERSION}") | ||
|
||
# Source package | ||
set(CPACK_SOURCE_GENERATOR "TGZ") | ||
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.vscode/;/.idea/") | ||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${INFLECTION_VERSION}") | ||
|
||
include(CPack) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a comment on top (or a separate document) that tells us how to update ICU dependancy:
Anything else I missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, will do that.