-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Such packages can be used by consumers and potentially in our CI. We directly create a new CI job for that. It creates a Debian package and a simple tar archive.
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
name: Package | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
description: Image to package on | ||
required: true | ||
type: string | ||
artifact-name: | ||
description: Artifact name of build dir | ||
required: false | ||
type: string | ||
default: 'build' | ||
package-name: | ||
description: Name of the resulting packages | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
deb: | ||
name: Create deb | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Install dpkg | ||
run: pacman -Sy --needed --quiet --noconfirm dpkg | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
- name: Untar artifact | ||
run: tar -xzf build-dir.tar | ||
- name: Run CPack | ||
run: cd build && cpack -G DEB -D CPACK_DEBIAN_FILE_NAME=${{ inputs.package-name }}.deb | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: deb-package | ||
path: build/_CPack_Packages/Linux/DEB/${{ inputs.package-name }}.deb | ||
retention-days: 8 | ||
|
||
tar: | ||
name: Create tar | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.image }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
- name: Untar artifact | ||
run: tar -xzf build-dir.tar | ||
- name: Run CPack | ||
# Need to use CPACK_PACKAGE_FILE_NAME instead of CPACK_ARCHIVE_FILE_NAME | ||
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/20419 | ||
run: cd build && cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=${{ inputs.package-name }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tar-package | ||
path: build/_CPack_Packages/Linux/TGZ/${{ inputs.package-name }}.tar.gz | ||
retention-days: 8 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SPDX-FileCopyrightText: 2024 Roman Gilg <[email protected]> | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
set(CPACK_PACKAGE_NAME theseus-ship CACHE STRING "Deb package name") | ||
set(CPACK_PACKAGE_VENDOR "WinFT") | ||
|
||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Roman Gilg") | ||
|
||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
|
||
set(CPACK_VERBATIM_VARIABLES YES) | ||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) | ||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) | ||
|
||
include(CPack) |