diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a219a713b..6eb787b67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: tags: - "v*" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-on-ubuntu2204: @@ -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 @@ -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: | @@ -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 \ No newline at end of file diff --git a/go.mod b/go.mod index ced2f25a5..f2ec24072 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 92d6ed932..004a54f7c 100644 --- a/go.sum +++ b/go.sum @@ -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=