Publish qsvpy Apple Silicon #34
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
name: Publish qsvpy Apple Silicon | |
on: | |
workflow_dispatch: | |
env: | |
QSV_KIND: prebuilt | |
jobs: | |
analyze-tags: | |
runs-on: ubuntu-22.04 | |
outputs: | |
previous-tag: ${{ steps.previoustag.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
#▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼# | |
- name: Get previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
#▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲# | |
publish: | |
name: Publish for ${{ matrix.job.target }} | |
needs: analyze-tags | |
runs-on: self-hosted | |
# runs-on: macos-latest | |
strategy: | |
matrix: | |
rust: [stable] | |
job: | |
- os: macos | |
os-name: macos | |
target: aarch64-apple-darwin | |
architecture: aarch64 | |
addl-build-args: --features=apply,fetch,foreach,self_update,luau,polars,to,geocode,python,lens | |
default-features: | |
addl-qsvlite-features: | |
addl-qsvdp-features: luau | |
steps: | |
- name: Installing Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
profile: minimal | |
target: ${{ matrix.job.target }} | |
override: true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
ref: ${{ needs.analyze-tags.outputs.previous-tag }} | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.10' | |
- name: Build qsvpy310 | |
env: | |
RUSTFLAGS: --emit=asm -C target-cpu=native | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
use-cross: false | |
toolchain: ${{ matrix.rust }} | |
args: --release --locked --bin qsv --target ${{ matrix.job.target }} ${{ matrix.job.addl-build-args }},feature_capable ${{ matrix.job.default-features }} | |
- name: Copy binaries to working dir | |
shell: bash | |
run: | | |
mkdir qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
rm target/${{ matrix.job.target }}/release/*.d | |
cp target/${{ matrix.job.target }}/release/qsv* qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
cd qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
mv qsv qsvpy310 | |
cd .. | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Build qsvpy311 | |
env: | |
RUSTFLAGS: --emit=asm -C target-cpu=native | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
use-cross: false | |
toolchain: ${{ matrix.rust }} | |
args: --release --locked --bin qsv --target ${{ matrix.job.target }} ${{ matrix.job.addl-build-args }},feature_capable ${{ matrix.job.default-features }} | |
- name: Copy binaries to working dir | |
shell: bash | |
run: | | |
rm target/${{ matrix.job.target }}/release/*.d | |
cp target/${{ matrix.job.target }}/release/qsv* qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
cd qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
mv qsv qsvpy311 | |
cd .. | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.12' | |
- name: Build qsvpy312 | |
env: | |
RUSTFLAGS: --emit=asm -C target-cpu=native | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
use-cross: false | |
toolchain: ${{ matrix.rust }} | |
args: --release --locked --bin qsv --target ${{ matrix.job.target }} ${{ matrix.job.addl-build-args }},feature_capable ${{ matrix.job.default-features }} | |
- name: Copy binaries to working dir | |
shell: bash | |
run: | | |
rm target/${{ matrix.job.target }}/release/*.d | |
cp target/${{ matrix.job.target }}/release/qsv* qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
cd qsv-${{ needs.analyze-tags.outputs.previous-tag }} | |
mv qsv qsvpy312 | |
cd .. | |
- name: install zipsign | |
run: | | |
cargo install zipsign | |
- name: Fetch zipsign private key | |
uses: mobiledevops/secret-to-file-action@v1 | |
with: | |
base64-encoded-secret: ${{ secrets.QSV_ZIPSIGN_PRIV_KEY }} | |
filename: "qsvpriv.key" | |
is-executable: false | |
working-directory: "." | |
- name: Download latest release zip | |
uses: robinraju/[email protected] | |
with: | |
repository: "dathere/qsv" | |
latest: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fileName: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip | |
- name: remove zipsign signature from zip archive | |
run: | | |
zipsign unsign zip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip | |
- name: install 7zip | |
run: brew install sevenzip | |
- name: add/update qsvpy files to zip | |
run: 7zz u -tzip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip ./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/qsv* -mx=9 -mmt=on | |
- name: re-zipsign zip archive | |
run: | | |
zipsign sign zip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip qsvpriv.key | |
cp qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip /tmp | |
- name: Upload zipped binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip | |
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip | |
overwrite: true | |
tag: ${{ needs.analyze-tags.outputs.previous-tag }} | |