Skip to content

Try the Linux build first #2

Try the Linux build first

Try the Linux build first #2

Workflow file for this run

name: Build release binaries
on:
push:
branches: ['travis/release-bin']
release:
types: ['published']
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
arch:
- amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Dist
if: runner.os == 'linux'
run: |
set -ex
platform=${{ matrix.os }}
platform_os=${platform//\//-}
mkdir $PWD/bin/dist
GOBIN=$PWD/bin go install -v ./cmd/utilities/compile_assets
$PWD/bin/compile_assets
pth="$platform_os-${{ matrix.arch }}"
GOOS=$platform_os GOARCH=${{ matrix.arch }} GOBIN=$PWD/bin go build -o $PWD/bin/$pth -a -ldflags "-X github.com/t2bot/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/...
GOOS=$platform_os GOARCH=${{ matrix.arch }} GOBIN=$PWD/bin go build -pgo=pgo_media_repo.pprof -o $PWD/bin/$pth -a -ldflags "-X github.com/t2bot/matrix-media-repo/common/version.Version=$(git describe --tags)" -v ./cmd/workers/media_repo
cd $PWD/bin/$pth
arch=${{ matrix.arch }}
if [ "$arch" == "amd64" ]; then
arch="x64"
fi
for file in * ; do mv -v $file ../dist/${file}-${platform_os}-${arch}; done;
cd ../../
rm -rv $PWD/bin/dist/compile_assets*
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: ./bin/dist/*