Skip to content

Commit

Permalink
Limit github action serialization and increase CI caching function (#698
Browse files Browse the repository at this point in the history
)

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n authored Dec 22, 2024
1 parent 1008d8b commit 848c8d9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
51 changes: 42 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

build-on-ubuntu2204:
Expand All @@ -16,7 +20,17 @@ jobs:
- 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
sudo apt-get install --yes --no-install-recommends \
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
Expand All @@ -35,22 +49,39 @@ jobs:
with:
submodules: 'recursive'
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- 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: Get Previous Tag
id: previoustag
run: |
PREVIOUS=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
echo "PREVIOUS_TAG=$PREVIOUS" >> $GITHUB_OUTPUT
- name: Generate Release Notes
id: release_notes
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/releases/generate-notes \
-f tag_name=${{ github.ref_name }} \
-f previous_tag_name=${{ steps.previoustag.outputs.PREVIOUS_TAG }} \
> release_notes.json
echo "NOTES=$(jq -r .body release_notes.json)" >> $GITHUB_OUTPUT
- name: Write File
uses: DamianReeves/write-file-action@v1.2
with:
path: ./bin/release_notes.txt
contents: |
${{ steps.github_release.outputs.changelog }}
${{ steps.release_notes.outputs.NOTES }}
write-mode: append
- name: Release amd64
run: |
Expand Down Expand Up @@ -89,6 +120,8 @@ jobs:
file: ./builder/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/ecapture:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/ecapture:buildcache,mode=max
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/ecapture:latest
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/spf13/pflag v1.0.5
golang.org/x/arch v0.8.0
golang.org/x/crypto v0.31.0
golang.org/x/net v0.25.0
golang.org/x/net v0.33.0
golang.org/x/sys v0.28.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
Expand Down

0 comments on commit 848c8d9

Please sign in to comment.