Skip to content

Commit

Permalink
publish workflow fine-tuning
Browse files Browse the repository at this point in the history
- squashed all the GH publish workflow fine-tuning

publish binaries with upx

refactor upx logic

separate discrete upx actions

otherwise, we get a workflow syntax error

turn off strip

as it causes errors on some target platforms

add upx and os check for qsvlite

add python feature to pre-built binaries

unnecessary whitespace causes GH syntax error

explicitly specify Python 3.8.12

remove quotes and use python 3.10.1

just use PYO3_PATH env var to setup python

every step must have uses or run key

ooops... wrong env var name

install python3-dev

try python feature on nix platforms first

troubleshoot python path

turn on PY03_PRINT_CONFIG for tblshooting

upx  not worth the trouble, remove it

python feature does not work with cross

del .d files before stripping

remove DEBUG;python feature from windows builds
  • Loading branch information
jqnatividad committed Dec 30, 2021
1 parent 37de4a5 commit 8eecf07
Showing 1 changed file with 19 additions and 44 deletions.
63 changes: 19 additions & 44 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,103 +33,93 @@ jobs:
os-name: linux
target: x86_64-unknown-linux-gnu
architecture: x86_64
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-x86_64-unknown-linux-gnu.zip
use-cross: false
strip: true
addl-build-args: --features=apply,generate,lua,foreach
upx: false
addl-build-args: --features=apply,generate,lua,foreach,python
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i686
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-i686-unknown-linux-gnu.zip
use-cross: true
strip: true
addl-build-args: --features=apply,generate,lua,foreach
upx: false
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-msvc
architecture: x86_64
artifact_name: qsv.exe
artifact_name: qsv*.exe
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-x86_64-pc-windows-msvc.zip
use-cross: false
strip: false
addl-build-args: --features=apply,generate,lua
upx: true
- os: windows-latest
os-name: windows
target: i686-pc-windows-msvc
architecture: i686
artifact_name: qsv.exe
artifact_name: qsv*.exe
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-i686-pc-windows-msvc.zip
use-cross: true
strip: false
addl-build-args: --features=apply,generate,lua
upx: true
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-gnu
architecture: x86_64
artifact_name: qsv.exe
artifact_name: qsv*.exe
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-x86_64-pc-windows-gnu.zip
use-cross: false
strip: false
addl-build-args: --no-default-features --features=apply,generate,lua
upx: true
- os: macos-latest
os-name: macos
target: x86_64-apple-darwin
architecture: x86_64
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-x86_64-apple-darwin.zip
use-cross: false
strip: true
addl-build-args: --features=apply,generate,lua,foreach
upx: true
addl-build-args: --features=apply,generate,lua,foreach,python
- os: macos-latest
os-name: macos
target: aarch64-apple-darwin
architecture: aarch64
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-aarch64-apple-darwin.zip
build-prep: true
use-cross: true
strip: true
addl-build-args: --features=apply,generate,lua,foreach
upx: true
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-gnu
architecture: aarch64
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-aarch64-unknown-linux-gnu.zip
use-cross: true
strip: false
addl-build-args: --features=apply,generate,lua,foreach
upx: false
- os: ubuntu-latest
os-name: linux
target: arm-unknown-linux-gnueabihf
architecture: arm
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-arm-unknown-linux-gnueabihf.zip
use-cross: true
strip: false
addl-build-args: --no-default-features --features=apply,generate,lua,foreach
upx: false
- os: ubuntu-latest
os-name: linux
target: arm-unknown-linux-musleabihf
architecture: arm
artifact_name: qsv
artifact_name: qsv*
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-arm-unknown-linux-musleabihf.zip
use-cross: true
strip: false
addl-build-args: --no-default-features --features=apply,generate,lua,foreach
upx: false

steps:
- name: Installing Rust toolchain
Expand All @@ -156,32 +146,17 @@ jobs:
use-cross: ${{ matrix.job.use-cross }}
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.job.target }} ${{ matrix.job.addl-build-args }}
# - name: strip binary on *nix environments
# if: ${{ matrix.job.strip }}
# run: strip target/${{ matrix.job.target }}/release/${{ matrix.job.artifact_name }}
- name: Copy binary to working dir
- name: strip binary on *nix environments
if: ${{ matrix.job.strip }}
run: |
rm target/${{ matrix.job.target }}/release/*.d
strip target/${{ matrix.job.target }}/release/${{ matrix.job.artifact_name }}
- name: Copy binaries to working dir
shell: bash
run: |
mkdir qsv-${{ needs.analyze-tags.outputs.previous-tag }}
cp target/${{ matrix.job.target }}/release/${{ matrix.job.artifact_name }} qsv-${{ needs.analyze-tags.outputs.previous-tag }}
- name: compress binaries with upx using brew on macos
if: ${{ matrix.job.os-name == 'macos' }}
run: |
brew install upx
cd qsv-${{ needs.analyze-tags.outputs.previous-tag }}
upx --verbose qsv
- name: compress binaries with GHA upx on windows/linux
if: ${{ matrix.job.os-name != 'macos' && matrix.job.upx }}
uses: crazy-max/ghaction-upx@v1
with:
version: latest
files: |
./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/*
args: --verbose
- name: if upx zip store binary
if: ${{ matrix.job.upx }}
run: 7z a -tzip ${{ matrix.job.asset_name }} ./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/${{ matrix.job.artifact_name }} -mx=0
- name: otherwise zip compress binary
- name: zip compress binary
if: ${{ matrix.job.upx == false }}
run: 7z a -tzip ${{ matrix.job.asset_name }} ./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/${{ matrix.job.artifact_name }} -mx=9 -mmt=on -mpass=7
- name: Upload binaries to release
Expand Down

0 comments on commit 8eecf07

Please sign in to comment.