gc: never prune the newest session #7
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| # Build the shims against an OLD glibc (debian 11, 2.31). A .so built | |
| # on the runner's modern glibc records symbol versions that do not | |
| # exist on older distros, and refuses to load there. Building old | |
| # keeps one binary working from glibc 2.6 upward. | |
| - name: build shims on old glibc | |
| run: | | |
| mkdir -p build | |
| docker run --rm -v "$PWD:/w" -w /w debian:11 bash -c ' | |
| apt-get update -qq && apt-get install -y -qq gcc gcc-aarch64-linux-gnu binutils | |
| gcc -shared -fPIC -O2 -Wall -o build/libundo_amd64.so shim/undo_shim.c -ldl | |
| aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -o build/libundo_arm64.so shim/undo_shim.c -ldl | |
| ' | |
| - name: assert the shims load on old distros | |
| run: | | |
| for f in build/libundo_amd64.so build/libundo_arm64.so; do | |
| max=$(objdump -T "$f" | grep -o 'GLIBC_[0-9.]*' | sort -u -V | tail -1) | |
| echo "$f requires up to $max" | |
| case "$max" in | |
| GLIBC_2.[0-9]|GLIBC_2.[12][0-9]) ;; | |
| *) echo "::error::$f needs $max, too new for common distros"; exit 1 ;; | |
| esac | |
| done | |
| - uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # PAT with push access to edaywalid/homebrew-tap; formula upload | |
| # fails gracefully absent while the release itself still publishes | |
| TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} |