-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d1dd98
commit 99f0ba6
Showing
2 changed files
with
92 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,20 @@ jobs: | |
release-publish: | ||
env: | ||
binary_name: dcontainer | ||
binary_name_nonupx: dcontainer.tgz | ||
|
||
|
||
runs-on: ubuntu-18.04 # critical - glibc from host is leaking into the pyoxidizer binary, see https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_distributing_linux.html#built-application-dependencies | ||
runs-on: ${{ matrix.config.runner }} | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- { | ||
trippletargets: "x86_64-unknown-linux-gnu", | ||
runner: ubuntu-18.04 # critical - glibc from host is leaking into the pyoxidizer binary, see https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_distributing_linux.html#built-application-dependencies | ||
} | ||
- { | ||
trippletargets: "x86_64-apple-darwin", | ||
runner: macos-12 | ||
} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -47,7 +57,7 @@ jobs: | |
oxidizer_location=$GITHUB_WORKSPACE | ||
wheel_location=./dist/$(ls dist | grep .whl) | ||
target_triple="x86_64-unknown-linux-gnu" | ||
target_triple=${{ matrix.config.trippletargets }} | ||
run_command="from dcontainer.__main__ import main; main()" | ||
python_version="3.10" | ||
|
@@ -60,39 +70,41 @@ jobs: | |
--var app_name $binary_name \ | ||
--target-triple $target_triple | ||
pyoxidizer analyze "$oxidizer_location/build/$target_triple/release/exe/$binary_name" | ||
if [ "${{ matrix.config.trippletargets }}" == "x86_64-unknown-linux-gnu" ]; then | ||
pyoxidizer analyze "$oxidizer_location/build/$target_triple/release/exe/$binary_name" | ||
fi | ||
mv "$oxidizer_location/build/$target_triple/release/exe/$binary_name" $GITHUB_WORKSPACE/build/$binary_name | ||
tar -zcvf $GITHUB_WORKSPACE/build/$binary_name_nonupx $GITHUB_WORKSPACE/build/$binary_name | ||
mv "$oxidizer_location/build/$target_triple/release/exe/$binary_name" $GITHUB_WORKSPACE/build/$binary_name-$target_triple | ||
tar -zcvf $GITHUB_WORKSPACE/build/$binary_name-$target_triple.tgz $GITHUB_WORKSPACE/build/$binary_name-$target_triple | ||
echo "binary_location=$GITHUB_WORKSPACE/build/$binary_name" >> "$GITHUB_OUTPUT" | ||
echo "binary_location_nonupx=$GITHUB_WORKSPACE/build/$binary_name_nonupx" >> "$GITHUB_OUTPUT" | ||
echo "binary_location=$GITHUB_WORKSPACE/build/$binary_name-$target_triple" >> "$GITHUB_OUTPUT" | ||
echo "binary_location_nonupx=$GITHUB_WORKSPACE/build/$binary_name-$target_triple.tgz" >> "$GITHUB_OUTPUT" | ||
- name: Strip Binary | ||
run: strip --strip-all ${{ steps.run_pyoxidizer.outputs.binary_location }} | ||
run: strip ${{ steps.run_pyoxidizer.outputs.binary_location }} | ||
|
||
- name: Compress Binary using UPX | ||
if: matrix.config.trippletargets == 'x86_64-unknown-linux-gnu' | ||
uses: crazy-max/ghaction-upx@v2 | ||
with: | ||
version: "v4.0.2" | ||
files: | | ||
${{ steps.run_pyoxidizer.outputs.binary_location }} | ||
args: --best | ||
|
||
# - name: Create Binary checksum | ||
# id: create_checksum | ||
|
||
- name: Create Binary checksum | ||
id: create_checksum | ||
# run: | | ||
|
||
run: | | ||
cd $(dirname ${{ steps.run_pyoxidizer.outputs.binary_location }}) | ||
sha256sum $binary_name $binary_name_nonupx > checksums.txt | ||
sha256sum -c checksums.txt | ||
echo "checksum_location=$(dirname ${{ steps.run_pyoxidizer.outputs.binary_location }})/checksums.txt" >> "$GITHUB_OUTPUT" | ||
# cd $(dirname ${{ steps.run_pyoxidizer.outputs.binary_location }}) | ||
# sha256sum $binary_name-${{ matrix.config.trippletargets }} $binary_name-${{ matrix.config.trippletargets }}.tgz > checksums.txt | ||
# sha256sum -c checksums.txt | ||
# echo "checksum_location=$(dirname ${{ steps.run_pyoxidizer.outputs.binary_location }})/checksums.txt" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Create GH Release and upload Binary and checksum | ||
uses: softprops/[email protected] | ||
with: | ||
files: | | ||
${{ steps.run_pyoxidizer.outputs.binary_location }} | ||
${{ steps.run_pyoxidizer.outputs.binary_location_nonupx }} | ||
${{ steps.create_checksum.outputs.checksum_location }} |
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