Skip to content

Commit 848c8d9

Browse files
authored
Limit github action serialization and increase CI caching function (#698)
Signed-off-by: CFC4N <[email protected]>
1 parent 1008d8b commit 848c8d9

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

.github/workflows/release.yml

+42-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
tags:
55
- "v*"
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812

913
build-on-ubuntu2204:
@@ -16,7 +20,17 @@ jobs:
1620
- name: Install Compilers
1721
run: |
1822
sudo apt-get update
19-
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
23+
sudo apt-get install --yes --no-install-recommends \
24+
build-essential \
25+
pkgconf \
26+
libelf-dev \
27+
llvm-14 \
28+
clang-14 \
29+
linux-tools-common \
30+
linux-tools-generic \
31+
gcc \
32+
gcc-aarch64-linux-gnu \
33+
linux-source
2034
for tool in "clang" "llc" "llvm-strip"
2135
do
2236
sudo rm -f /usr/bin/$tool
@@ -35,22 +49,39 @@ jobs:
3549
with:
3650
submodules: 'recursive'
3751
fetch-depth: 0
52+
- uses: actions/cache@v4
53+
with:
54+
path: |
55+
~/.cache/go-build
56+
~/go/pkg/mod
57+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58+
restore-keys: |
59+
${{ runner.os }}-go-
3860
- name: authenticate
3961
run: |
4062
gh auth login --with-token <<<'${{ secrets.GITHUB_TOKEN }}'
41-
- name: Build Changelog
42-
id: github_release
43-
uses: mikepenz/release-changelog-builder-action@v1
44-
with:
45-
configuration: "configuration.json"
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
- name: Get Previous Tag
64+
id: previoustag
65+
run: |
66+
PREVIOUS=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
67+
echo "PREVIOUS_TAG=$PREVIOUS" >> $GITHUB_OUTPUT
68+
- name: Generate Release Notes
69+
id: release_notes
70+
run: |
71+
gh api \
72+
--method POST \
73+
-H "Accept: application/vnd.github+json" \
74+
/repos/${{ github.repository }}/releases/generate-notes \
75+
-f tag_name=${{ github.ref_name }} \
76+
-f previous_tag_name=${{ steps.previoustag.outputs.PREVIOUS_TAG }} \
77+
> release_notes.json
78+
echo "NOTES=$(jq -r .body release_notes.json)" >> $GITHUB_OUTPUT
4879
- name: Write File
4980
uses: DamianReeves/[email protected]
5081
with:
5182
path: ./bin/release_notes.txt
5283
contents: |
53-
${{ steps.github_release.outputs.changelog }}
84+
${{ steps.release_notes.outputs.NOTES }}
5485
write-mode: append
5586
- name: Release amd64
5687
run: |
@@ -89,6 +120,8 @@ jobs:
89120
file: ./builder/Dockerfile
90121
platforms: linux/amd64,linux/arm64
91122
push: true
123+
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/ecapture:buildcache
124+
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/ecapture:buildcache,mode=max
92125
tags: |
93126
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:${{ github.ref_name }}
94127
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:latest

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/spf13/pflag v1.0.5
1515
golang.org/x/arch v0.8.0
1616
golang.org/x/crypto v0.31.0
17-
golang.org/x/net v0.25.0
17+
golang.org/x/net v0.33.0
1818
golang.org/x/sys v0.28.0
1919
)
2020

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qx
197197
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
198198
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
199199
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
200+
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
201+
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
200202
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
201203
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
202204
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=

0 commit comments

Comments
 (0)