Skip to content

Commit

Permalink
Merge in base version from OBS (#1)
Browse files Browse the repository at this point in the history
Added templates and update the CI to work with Github Actions via sudo and other prep
  • Loading branch information
maltob authored Nov 25, 2024
1 parent e845c8a commit 4798b95
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
bash install_prereq_ubuntu.sh
- name: Package an app
run: |
mkdir /out/
sudo mkdir /out/ && sudo chmod 777 /out/
bash download.sh
python build_a_pkg.py
- name: Test with pytest
uses: actions/upload-artifact@v4.4.3
Expand Down
2 changes: 2 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdir input
curl "https://cdn-fastly.obsproject.com/downloads/obs-studio-30.2.3-macos-intel.dmg" -o "input/obs-studio-30.2.3-macos-intel.dmg"
8 changes: 4 additions & 4 deletions install_prereq_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#assumes ubuntu:24.04

apt update -y && apt install -y python3 curl xz-utils git build-essential autoconf libxml2-dev libssl-dev zlib1g-dev
curl https://www.7-zip.org/a/7z2408-linux-x64.tar.xz -o 7z.tar.xz && tar -xf 7z.tar.xz 7zzs && cp 7zzs /usr/bin/7zzs && chmod +x /usr/bin/7zzs
sudo apt update -y && sudo apt install -y python3 curl xz-utils git build-essential autoconf libxml2-dev libssl-dev zlib1g-dev
curl https://www.7-zip.org/a/7z2408-linux-x64.tar.xz -o 7z.tar.xz && tar -xf 7z.tar.xz 7zzs && sudo cp 7zzs /usr/bin/7zzs && sudo chmod +x /usr/bin/7zzs
git clone "https://github.com/maltob/bomutils.git" /tmp/bomutils
git clone "https://github.com/mackyle/xar.git" /tmp/xar
cd /tmp/bomutils/
make && make install
make && sudo make install
cd /tmp/xar/xar
sed -i 's/OpenSSL_add_all_ciphers/OPENSSL_init_crypto/g' configure.ac && ./autogen.sh && make && make install
sed -i 's/OpenSSL_add_all_ciphers/OPENSSL_init_crypto/g' configure.ac && ./autogen.sh && make && sudo cp src/xar /usr/bin/xar && sudo chmod +x /usr/bin/xar
24 changes: 24 additions & 0 deletions templates/Distribution.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">
<title>${APP_NAME}</title>
<options customize="never" allow-external-scripts="no"/>
<domains enable_anywhere="true"/>
<installation-check script="pm_install_check();"/>
<script>function pm_install_check() {
if(!(system.compareVersions(system.version.ProductVersion,'${MIN_OS_VERSION}') >= 0)) {
my.result.title = 'Failure';
my.result.message = 'You need at least MacOS ${MIN_OS_VERSION} to install ${APP_NAME}.';
my.result.type = 'Fatal';
return false;
}
return true;
}
</script>
<choices-outline>
<line choice="choice1"/>
</choices-outline>
<choice id="choice1" title="base">
<pkg-ref id="${CFBUNDLE_IDENTIFIER}"/>
</choice>
<pkg-ref id="${CFBUNDLE_IDENTIFIER}" installKBytes="${INSTALL_KBYTES}" version="${PKG_VERSION}" auth="Root">#base.pkg</pkg-ref>
</installer-script>
9 changes: 9 additions & 0 deletions templates/PackageInfo.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<pkg-info overwrite-permissions="true" relocatable="false" identifier="${CFBUNDLE_IDENTIFIER}" postinstall-action="none" version="${PKG_VERSION}" format-version="2" generator-version="build_a_pkgPy" install-location="${INSTALL_LOCATION}" auth="root">
<payload numberOfFiles="${NUMBER_OF_FILES}" installKBytes="${INSTALL_KBYTES}"/>
<bundle-version>
<bundle id="${CFBUNDLE_IDENTIFIER}" CFBundleIdentifier="${CFBUNDLE_IDENTIFIER}" path="${APP_PATH}" CFBundleVersion="${CFBUNDLEVERSION}"/>
</bundle-version>
<relocate/>
<scripts/>
</pkg-info>

0 comments on commit 4798b95

Please sign in to comment.