Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
ci-templates
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andri Joos
ci-templates
Commits
9e07a014
Commit
9e07a014
authored
5 months ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
add linux build
parent
039d44e5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flutter/flutter-linux.gitlab-ci.yml
+39
-0
39 additions, 0 deletions
flutter/flutter-linux.gitlab-ci.yml
linux/appimage.gitlab-ci.yml
+81
-0
81 additions, 0 deletions
linux/appimage.gitlab-ci.yml
linux/snap.gitlab-ci.yml
+53
-0
53 additions, 0 deletions
linux/snap.gitlab-ci.yml
with
173 additions
and
0 deletions
flutter/flutter-linux.gitlab-ci.yml
0 → 100644
+
39
−
0
View file @
9e07a014
# Required variables:
## APP_DIRECTORY: The directory of the app
## APPLICATION_VERSION: The build name of the application
## APPLICATION_BUILD_NUMBER: The build number of the application
## LINUX_BIN_NAME: The name of the output bin
stages
:
-
build
variables
:
FLUTTER_LINUX_IMAGE
:
andrijoos/flutter:3.24.5-linux
APPIMAGE_BUILDER_IMAGE
:
appimagecrafters/appimage-builder:1.1.0
LINUX_PLATFORMS
:
x64
# linux-arm64 not available yet, as cross-compilation not supported
.build_linux
:
stage
:
build
image
:
${FLUTTER_LINUX_IMAGE}
tags
:
-
amd64
artifacts
:
paths
:
-
x64
expire_in
:
1 day
script
:
-
cd ${APP_DIRECTORY}
-
|
IFS=',' read -r -a platforms <<< "${LINUX_PLATFORMS}"
for platform in "${platforms[@]}"; do
flutter build linux --release --target-platform linux-${platform} --build-name ${APPLICATION_VERSION} --build-number ${APPLICATION_BUILD_NUMBER}
done
after_script
:
-
|
IFS=',' read -r -a platforms <<< "${LINUX_PLATFORMS}"
for platform in "${platforms[@]}"; do
mkdir -p ${platform}
mv ${APP_DIRECTORY}/build/linux/x64/release/bundle/* ./${platform}
mv ${platform}/${APP_NAME} ${platform}/${LINUX_BIN_NAME}
done
This diff is collapsed.
Click to expand it.
linux/appimage.gitlab-ci.yml
0 → 100644
+
81
−
0
View file @
9e07a014
# Required variables:
## APP_NAME
## APP_DIR
## APPIMAGE_VERSION
## APPIMAGE_BUILDER_CONFIG
## APPIMAGE_EXECUTABLE_NAME
## APPIMAGE_ICON
## APPIMAGE_ICON_DIMENSIONS
## APPIMAGE_NAME
stages
:
-
build
variables
:
APPIMAGE_BUILDER_IMAGE
:
appimagecrafters/appimage-builder:1.1.0
APPIMAGE_PLATFORM
:
x86_64
APPIMAGE_SIGN_KEY
:
None
APPIMAGE_SIGN
:
false
.build_appimage
:
stage
:
build
image
:
${APPIMAGE_BUILDER_IMAGE}
tags
:
-
amd64
artifacts
:
paths
:
-
"
*.AppImage"
-
"
*.AppImage.zsync"
-
"
*.asc"
expire_in
:
1 day
variables
:
APPDIR_SUBDIR
:
AppDir
script
:
-
which mksquashfs || apt install squashfs-tools
# appimagecrafters/appimage-builder currently doesn't provide mksquashfs https://github.com/AppImageCrafters/appimage-builder/issues/271
-
|
if [ "${APPIMAGE_SIGN}" == "true" ]
then
echo "${APPIMAGE_SIGN_CERTIFICATE}" | base64 -d | gpg2 --batch --import
fi
-
|
APPDIR_PATH=$PWD/${APPDIR_SUBDIR}
ICON=$(basename "${APPIMAGE_ICON}")
ICON_DIR="${APPDIR_SUBDIR}/usr/share/icons/hicolor/${APPIMAGE_ICON_DIMENSIONS}/apps/"
sed -i "s|\${APPDIR_PATH}|${APPDIR_PATH}|" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${APP_NAME}/${APP_NAME}/" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${VERSION}/${APPIMAGE_VERSION}/" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${ICON}/${ICON}/" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${EXECUTABLE}/${APPIMAGE_EXECUTABLE_NAME}/" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${SIGN_KEY}/\"\"/" ${APPIMAGE_BUILDER_CONFIG}
sed -i "s/\${ARCH}/${APPIMAGE_PLATFORM}/" ${APPIMAGE_BUILDER_CONFIG}
if [ "${APPIMAGE_PLATFORM}" == "x86_64" ]
then
APT_ARCH="amd64"
elif [ "${APPIMAGE_PLATFORM}" == "arm64" ]
then
APT_ARCH="arm64"
fi
BUILDER_CONFIG="builder_config.yml"
cp ${APPIMAGE_BUILDER_CONFIG} ${BUILDER_CONFIG}
sed -i "s/\${APT_ARCH}/${APT_ARCH}/" ${BUILDER_CONFIG}
mkdir -p ${APPDIR_SUBDIR}
mv ${APP_DIR}/* ${APPDIR_SUBDIR}
mkdir -p ${ICON_DIR}
cp ${APPIMAGE_ICON} ${ICON_DIR}
appimage-builder --skip-tests --recipe ${BUILDER_CONFIG}
GENERATED_APPIMAGE_NAME="${APP_NAME}-${APPIMAGE_VERSION}-${APPIMAGE_PLATFORM}"
mv ${GENERATED_APPIMAGE_NAME}.AppImage ${APPIMAGE_NAME}.AppImage
mv ${GENERATED_APPIMAGE_NAME}.AppImage.zsync ${APPIMAGE_NAME}.AppImage.zsync
if [ "${APPIMAGE_SIGN}" == "true" ]
then
gpg2 --pinentry-mode loopback --passphrase ${APPIMAGE_SIGN_PASSWORD} --sign --detach-sig --armor --default-key ${APPIMAGE_SIGN_KEY} ${APPIMAGE_NAME}.AppImage
fi
This diff is collapsed.
Click to expand it.
linux/snap.gitlab-ci.yml
0 → 100644
+
53
−
0
View file @
9e07a014
# Required variables:
## APP_NAME
## APP_DIR
## APP_VERSION
## APP_SUMMARY
## APP_DESCRIPTION
## SNAP_BASE
## SNAP_GRADE
## SNAP_COMMAND
## SNAP_PLATFORM
## SNAP_NAME
## SNAP_CONFIG
stages
:
-
build
variables
:
SNAPCRAFT_IMAGE
:
ghcr.io/canonical/snapcraft:8_core24
SNAP_CONFINMENT
:
strict
.build_snap
:
stage
:
build
image
:
${SNAPCRAFT_IMAGE}
tags
:
-
amd64
artifacts
:
paths
:
-
"
*.snap"
expire_in
:
1 day
variables
:
BUILD_DIR
:
build
script
:
-
|
sed -i "s/\${APP_NAME}/${APP_NAME}/" ${SNAP_CONFIG}
sed -i "s/\${VERSION}/${APP_VERSION}/" ${SNAP_CONFIG}
sed -i "s/\${SUMMARY}/${APP_SUMMARY}/" ${SNAP_CONFIG}
sed -i "s/\${DESCRIPTION}/${APP_DESCRIPTION}/" ${SNAP_CONFIG}
sed -i "s/\${CONFINEMENT}/${SNAP_CONFINMENT}/" ${SNAP_CONFIG}
sed -i "s/\${BASE}/${SNAP_BASE}/" ${SNAP_CONFIG}
sed -i "s/\${GRADE}/${SNAP_GRADE}/" ${SNAP_CONFIG}
sed -i "s/\${COMMAND}/${SNAP_COMMAND}/" ${SNAP_CONFIG}
mkdir -p ${BUILD_DIR}/meta
cp -r ${APP_DIR}/* ${BUILD_DIR}
cp ${SNAP_CONFIG} ${BUILD_DIR}/meta/snap.yaml
snapcraft pack --platform ${SNAP_PLATFORM} ${BUILD_DIR}
rm -r ${BUILD_DIR}
GENERATED_SNAP="${APP_NAME}_${APP_VERSION}_all.snap"
ls .
mv "${GENERATED_SNAP}" "${SNAP_NAME}.snap"
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment