Skip to content

Commit

Permalink
add docker test build to build file
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver006 committed Sep 9, 2024
1 parent d2e711a commit 956e972
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
push:
branches:
- '*'
tags:
- 'v*'

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23'

- name: Install Dependencies
run: |
make build-all-binaries
ls -la
./package-github-binaries.sh
ls -la dist/
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,12 @@ jobs:

- name: Generate mixin
run: make mixin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test Docker Build
uses: docker/build-push-action@v6
with:
push: false
tags: user/app:tst
35 changes: 35 additions & 0 deletions package-github-binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash


set -u -e -o pipefail

if [[ -z "${DRONE_TAG}" ]] ; then
echo 'ERROR: Missing DRONE_TAG env'
exit 1
fi

echo "go install ghr"
go install github.com/tcnksm/[email protected]

mkdir -p dist

for build in $(ls .build); do
echo "Creating archive for ${build}"

cp LICENSE README.md ".build/${build}/"

if [[ "${build}" =~ windows-.*$ ]] ; then

# Make sure to clear out zip files to prevent zip from appending to the archive.
rm "dist/${build}.zip" || true
cd ".build/" && zip -r --quiet -9 "../dist/${build}.zip" "${build}" && cd ../
else
tar -C ".build/" -czf "dist/${build}.tar.gz" "${build}"
fi
done

cd dist
sha256sum *.gz *.zip > sha256sums.txt
ls -la
cd ..

0 comments on commit 956e972

Please sign in to comment.