feat(output): Add -C
and -W
flags for output file rotation based on size and count
#417
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-test | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master", "dev" ] | |
pull_request: | |
branches: [ "master", "dev" ] | |
permissions: | |
contents: read | |
jobs: | |
release-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Set up Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5 | |
with: | |
# renovate: datasource=golang-version depName=golang | |
go-version: '1.23.6' | |
- name: Install govulncheck | |
run: go install golang.org/x/vuln/cmd/govulncheck@latest | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6 | |
with: | |
distribution: goreleaser | |
version: '~> v2' | |
args: release --snapshot --clean --skip=publish -p 1 | |
- name: Test binary | |
run: | | |
mkdir amd64 && tar zxvf dist/ptcpdump_v0.0.0-next_linux_amd64.tar.gz -C amd64 | |
mkdir arm64 && tar zxvf dist/ptcpdump_v0.0.0-next_linux_arm64.tar.gz -C arm64 | |
./amd64/ptcpdump --version | |
file ./amd64/ptcpdump |grep x86-64 |grep 'statically linked' | |
file ./arm64/ptcpdump |grep aarch64 |grep 'statically linked' | |
- name: Run govulncheck for binary | |
run: | | |
set -xe | |
govulncheck -mode=binary -show verbose -scan module ./amd64/ptcpdump | |
govulncheck -mode=binary -show verbose -scan module ./arm64/ptcpdump | |
- name: Store Releases | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: ptcpdump_v0.0.0-next_linux_amd64.tar.gz | |
path: dist/ptcpdump_v0.0.0-next_linux_amd64.tar.gz | |
- name: Store Releases | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: ptcpdump_v0.0.0-next_linux_arm64.tar.gz | |
path: dist/ptcpdump_v0.0.0-next_linux_arm64.tar.gz | |
artifact-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'ubuntu-24.04-arm'] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 5 | |
needs: release-test | |
steps: | |
- name: Retrieve stored artifact (amd64) | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
if: ${{ !contains(matrix.os, 'arm') }} | |
with: | |
name: ptcpdump_v0.0.0-next_linux_amd64.tar.gz | |
- name: Retrieve stored artifact (arm64) | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
if: ${{ contains(matrix.os, 'arm') }} | |
with: | |
name: ptcpdump_v0.0.0-next_linux_arm64.tar.gz | |
- name: untar artifact | |
run: | | |
if uname -a |grep x86_64; then | |
ARCH=amd64 | |
else | |
ARCH=arm64 | |
fi | |
tar zxvf ptcpdump_v0.0.0-next_linux_${ARCH}.tar.gz | |
- name: Test binary | |
run: | | |
set -xe | |
uname -a | |
./ptcpdump --version | |
sudo ./ptcpdump -i any -c 2 |