Skip to content

Commit d4820fc

Browse files
committed
add release ci
1 parent 908d8f7 commit d4820fc

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: release
2+
3+
env:
4+
PROJECT_NAME: qdl
5+
REPO_NAME: linux-msm/qdl
6+
REPO_REF: 672abb1e81cc630640f2a88e42b6dfd2a429ad14
7+
DIST_DIR: dist
8+
ARTIFACT_NAME: dist
9+
10+
on:
11+
push:
12+
tags:
13+
- '*.*.*'
14+
15+
jobs:
16+
build:
17+
name: build (${{ matrix.config.os }}, ${{ matrix.config.arch }})
18+
runs-on:
19+
ubuntu-latest
20+
permissions:
21+
contents: read
22+
strategy:
23+
matrix:
24+
config:
25+
- os: Linux
26+
arch: 64bit
27+
cross_compile: x86_64-ubuntu16.04-linux-gnu
28+
- os: Linux
29+
arch: 32bit
30+
cross_compile: i686-ubuntu16.04-linux-gnu
31+
- os: Linux
32+
arch: ARMv6
33+
cross_compile: arm-linux-gnueabihf
34+
- os: Linux
35+
arch: ARM64
36+
cross_compile: aarch64-linux-gnu
37+
- os: macOS
38+
arch: 64bit
39+
cross_compile: x86_64-apple-darwin13
40+
- os: Windows
41+
arch: 32bit
42+
cross_compile: i686-w64-mingw32
43+
extension: .exe
44+
45+
container:
46+
image: ghcr.io/arduino/crossbuild:0.3.0-pre.1
47+
48+
steps:
49+
- name: Checkout avrdude-packing repository
50+
uses: actions/checkout@v4
51+
with:
52+
path: packing
53+
54+
- name: Checkout linux-msm/qdl repository
55+
uses: actions/checkout@v4
56+
with:
57+
repository: ${{ env.REPO_NAME }}
58+
ref: ${{ env.REPO_REF }}
59+
path: ${{ env.PROJECT_NAME }}
60+
61+
- name: Apply patches
62+
working-directory: ${{ env.PROJECT_NAME }}
63+
run: git apply -v ../packing/patches/*.patch
64+
65+
- name: Build
66+
run: /configure_toolchain.sh make -j$(nproc)
67+
working-directory: ${{ env.PROJECT_NAME }}
68+
env:
69+
CROSS_COMPILE: ${{ matrix.config.cross_compile }}
70+
71+
- name: Package
72+
run: |
73+
tar -czvf ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz qdl${{ matrix.config.extension }}
74+
75+
- name: Upload artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
if-no-files-found: error
79+
name: ${{ env.ARTIFACT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
80+
path: ${{ env.PROJECT_NAME }}_${{ github.ref_name }}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz
81+
82+
create-release:
83+
needs: build
84+
runs-on: ubuntu-latest
85+
permissions:
86+
contents: write
87+
steps:
88+
- name: Download artifact
89+
uses: actions/download-artifact@v4
90+
with:
91+
pattern: ${{ env.ARTIFACT_NAME }}*
92+
path: ${{ env.DIST_DIR }}
93+
merge-multiple: true
94+
95+
- name: Create Github Release and upload artifacts
96+
uses: ncipollo/release-action@v1
97+
with:
98+
token: ${{ secrets.GITHUB_TOKEN }}
99+
draft: false
100+
artifacts: "${{ env.DIST_DIR }}/*"

patches/build_static.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/Makefile b/Makefile
2+
index 203cb04..4482eb8 100644
3+
--- a/Makefile
4+
+++ b/Makefile
5+
@@ -3,7 +3,7 @@ RAMDUMP := qdl-ramdump
6+
VERSION := $(or $(VERSION), $(shell git describe --dirty --always --tags 2>/dev/null), "unknown-version")
7+
8+
CFLAGS += -O2 -Wall -g `pkg-config --cflags libxml-2.0 libusb-1.0`
9+
-LDFLAGS += `pkg-config --libs libxml-2.0 libusb-1.0`
10+
+LDFLAGS += `pkg-config --libs libxml-2.0 libusb-1.0 --static`
11+
prefix := /usr/local
12+
13+
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

0 commit comments

Comments
 (0)