-
-
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Build & Package (Ubuntu) | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
build-and-package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Setup Git LFS | ||
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. We can land it as is for now, but fix it after Frank lands 128 (LFS caching). |
||
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: Install ICU 77.1 | ||
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. ICU caching already landed - we can use it here to save bandwidth. |
||
run: | | ||
cd /tmp | ||
wget https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz | ||
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. Why do we download and compile sources? Why not just download and install binary release for Ubuntu? It takes time to compile ICU. One needs to only copy the $download_location/usr tree to /usr/local/ folder 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. See https://github.com/unicode-org/inflection/pull/128/files for example on how to do it. |
||
tar xzf icu4c-77_1-src.tgz | ||
cd icu/source | ||
./configure --prefix=/usr/local | ||
make -j$(nproc) | ||
sudo make install | ||
sudo ldconfig | ||
|
||
- name: Configure & Build | ||
run: | | ||
mkdir -p build | ||
cd 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 build | ||
make check | ||
|
||
- name: Package with CPack | ||
run: | | ||
cd build | ||
cpack | ||
ls -la *.deb *.tar.gz | ||
|
||
- name: Upload release artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ubuntu-release-artifacts | ||
path: | | ||
build/*.deb | ||
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: | | ||
build/*.deb | ||
build/*.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,23 @@ 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") | ||
set(CPACK_PACKAGE_VENDOR "Unicode Consortium") | ||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
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 think we need to find another contact. I'm not sure that I'm ready to have my email address here. 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. Is that a mandatory field? If we have to have it, we can use the [email protected] one. 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’d prefer just listing the official GitHub project. The discussion page can be used for communication. 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. Agree. |
||
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 "libicu-dev (>= 77.1)") | ||
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. The dev part is only needed for building. The non-dev dependency is needed for runtime. |
||
set(CPACK_DEBIAN_PACKAGE_SECTION "libs") | ||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") | ||
|
||
# Source package | ||
set(CPACK_SOURCE_GENERATOR "TGZ") | ||
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.vscode/;/.idea/") | ||
|
||
include(CPack) |
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.
I don't think we need the master part. It's obsolete and our repo doesn't have it.