forked from gojue/ecapture
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (92 loc) · 3.16 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Release
on:
push:
tags:
- "v*"
jobs:
build-on-ubuntu2204:
runs-on: ubuntu-22.04
name: release Linux/Android Version (amd64/arm64)
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.0'
- name: Install Compilers
run: |
sudo apt-get update
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-common linux-tools-generic gcc gcc-aarch64-linux-gnu linux-source
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
cd /usr/src
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- prepare V=0
ls -al /usr/src/$source_dir
shell: bash
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: authenticate
run: |
gh auth login --with-token <<<'${{ secrets.GITHUB_TOKEN }}'
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: "configuration.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Write File
uses: DamianReeves/[email protected]
with:
path: ./bin/release_notes.txt
contents: |
${{ steps.github_release.outputs.changelog }}
write-mode: append
- name: Release amd64
run: |
make clean
make env
make -f builder/Makefile.release release SNAPSHOT_VERSION=${{ github.ref_name }}
- name: Release arm64 (CROSS COMPILATION)
run: |
make clean
make env
CROSS_ARCH=arm64 make -f builder/Makefile.release release SNAPSHOT_VERSION=${{ github.ref_name }}
- name: Publish
run: |
make -f builder/Makefile.release publish SNAPSHOT_VERSION=${{ github.ref_name }}
build-docker-image:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Update submodule
run: git submodule update --init
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
build-args: VERSION=${{ github.ref_name }}
file: ./builder/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:latest