Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 84 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: release
env:
PROJECT_NAME: qdl
REPO_NAME: linux-msm/qdl
REPO_REF: 672abb1e81cc630640f2a88e42b6dfd2a429ad14
REPO_REF: v2.2
DIST_DIR: dist
ARTIFACT_NAME: dist

on:
workflow_dispatch:
push:
tags:
- '*.*.*'
- '*'

jobs:
build:
name: build (${{ matrix.config.os }}, ${{ matrix.config.arch }})
name: build
runs-on:
ubuntu-latest
permissions:
Expand Down Expand Up @@ -71,20 +72,89 @@ jobs:
- name: Package
working-directory: ${{ env.PROJECT_NAME }}
run: |
tar -czvf ../${{ env.PROJECT_NAME }}_${{ github.ref_name }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz \
tar -czvf ../${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz \
qdl${{ matrix.config.extension }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
path: ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz
path: ${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz

build-macos-arm64:
name: build
permissions:
contents: read
strategy:
matrix:
config:
- os: macOS
arch: arm64
runs-on: macos-latest
env:
CROSSBUILD_REF: main
steps:
- name: Install dependencies
run: |
brew install pkg-config autoconf automake libtool

- name: Checkout repository
uses: actions/checkout@v4
with:
path: packing

- name: Checkout arduino/crossbuild repository
uses: actions/checkout@v4
with:
repository: arduino/crossbuild
ref: ${{ env.CROSSBUILD_REF }}
path: crossbuild
- name: build dependencies
working-directory: crossbuild
run: ./scripts/build_mac.sh

- name: Checkout linux-msm/qdl repository
uses: actions/checkout@v4
with:
repository: ${{ env.REPO_NAME }}
ref: ${{ env.REPO_REF }}
path: ${{ env.PROJECT_NAME }}
- name: Apply patches
working-directory: ${{ env.PROJECT_NAME }}
run: git apply -v ../packing/patches/*.patch

- name: build qdl
working-directory: ${{ env.PROJECT_NAME }}
run: make -j 8
env:
PKG_CONFIG_PATH: ../crossbuild/build/macos/dist/lib/pkgconfig
LD_LIBRARY_PATH: ../crossbuild/build/macos/dist/lib
C_INCLUDE_PATH: ../crossbuild/build/macos/dist/include

- name: Package
working-directory: ${{ env.PROJECT_NAME }}
run: |
tar -czvf ../${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz qdl

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
path: ${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz

sign-and-notarize-macos:
name: sign and notarize (macOS, 64bit)
name: sign and notarize
runs-on: macos-latest
needs: build
needs: [build, build-macos-arm64]
strategy:
matrix:
config:
- os: macOS
arch: 64bit
- os: macOS
arch: arm64
permissions:
contents: read

Expand All @@ -98,12 +168,12 @@ jobs:
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}_macOS_64bit
name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
path: ${{ env.DIST_DIR }}/notarize_temp

- name: Extract macOS binary
working-directory: ${{ env.DIST_DIR }}/notarize_temp
run: tar -xzvf ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_macOS_64bit.tar.gz
run: tar -xzvf ${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz

- name: Import Code-Signing Certificates
env:
Expand Down Expand Up @@ -147,19 +217,19 @@ jobs:
working-directory: ${{ env.DIST_DIR }}/notarize_temp
run: |
chmod +x qdl
tar -czvf ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_macOS_64bit.tar.gz qdl
mv ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_macOS_64bit.tar.gz ../
tar -czvf ${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz qdl
mv ${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz ../

- name: Upload notarized macOS artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}_macOS_64bit
path: ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${{ github.ref_name }}_macOS_64bit.tar.gz
name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
path: ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${{ env.REPO_REF }}-${{ github.run_number }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz
overwrite: true # Important: replace the original macOS artifact

create-release:
needs: [build, sign-and-notarize-macos]
needs: [build, sign-and-notarize-macos, build-macos-arm64]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
8 changes: 4 additions & 4 deletions patches/build_static.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Makefile b/Makefile
index 203cb04..4482eb8 100644
index a8fb0da..39c9cc5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ RAMDUMP := qdl-ramdump
Expand All @@ -8,6 +8,6 @@ index 203cb04..4482eb8 100644
CFLAGS += -O2 -Wall -g `pkg-config --cflags libxml-2.0 libusb-1.0`
-LDFLAGS += `pkg-config --libs libxml-2.0 libusb-1.0`
+LDFLAGS += `pkg-config --libs libxml-2.0 libusb-1.0 --static`
prefix := /usr/local

QDL_SRCS := firehose.c io.c qdl.c sahara.c util.c patch.c program.c read.c sim.c ufs.c usb.c ux.c oscompat.c
ifeq ($(OS),Windows_NT)
LDFLAGS += -lws2_32
endif