Skip to content

Commit

Permalink
- adding armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ognian committed Apr 11, 2022
1 parent 9a436ca commit 7bba09a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/buildwithdocker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
# run: env
- name: Compile for linux/arm64
# see https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output this allows that all files created by docker are written somewhere
run: docker build . --platform linux/arm64 --build-arg VERSION_STRING="${{env.version_string}}" -o type=local,dest=build/arm64 && cd build/arm64/usr/src/app && tar -czf $GITHUB_WORKSPACE/build/sdmon-arm64.tar.gz sdmon
# - name: Compile for linux/armv7
# # see https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output this allows that all files created by docker are written somewhere
# run: docker build . --platform linux/arm64 --build-arg VERSION_STRING=${VERSION_STRING} -o type=local,dest=build/armv7 && cd build/armv7/usr/src/app && tar -czf $GITHUB_WORKSPACE/build/sdmon-armv7.tar.gz sdmon
run: docker build . --platform linux/arm64 --build-arg VERSION_STRING="${{env.version_string}} arm64" -o type=local,dest=build/arm64 && cd build/arm64/usr/src/app && tar -czf $GITHUB_WORKSPACE/build/sdmon-arm64.tar.gz sdmon
- name: Compile for linux/armv7
# see https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output this allows that all files created by docker are written somewhere
run: docker build . --platform linux/arm64 --build-arg VERSION_STRING="${{env.version_string}} armv7" -o type=local,dest=build/arm/v7 && cd build/armv7/usr/src/app && tar -czf $GITHUB_WORKSPACE/build/sdmon-armv7.tar.gz sdmon
# **********
# ***** end of CI *****
# **********
Expand All @@ -74,7 +74,7 @@ jobs:
prerelease: false
files: |
build/sdmon-arm64.tar.gz
# build/sdmon-armv7.tar.gz
build/sdmon-armv7.tar.gz
id: "automatic_releases_tagged"
- name: Release if prerelease
if: ${{startsWith(github.ref, 'refs/heads/master')}}
Expand All @@ -86,5 +86,5 @@ jobs:
title: "Development Build"
files: |
build/sdmon-arm64.tar.gz
# build/sdmon-armv7.tar.gz
build/sdmon-armv7.tar.gz
id: "automatic_releases_not_tagged"
24 changes: 24 additions & 0 deletions buildwithdocker-armv7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -e exit if any command fails, -x print commands as they are executed
set -ex
# make output dir
mkdir -p build/armv7

# set correct version
GIT_COMMIT=`git rev-parse --short HEAD`
GIT_TAG=`git describe --abbrev=0 --dirty`
VERSION_STRING="$GIT_TAG ($GIT_COMMIT)"

# build container
docker buildx build --no-cache --progress plain -t "ogi-it/sdmon:latest" --platform linux/arm/v7 --build-arg VERSION_STRING=${VERSION_STRING} ./

# create container
docker create --name sdmonbuild ogi-it/sdmon

# copy
docker cp sdmonbuild:/usr/src/app/sdmon ./build/armv7
base64 ./build/armv7/sdmon > ./build/armv7/sdmon.txt

#cleanup
docker container stop sdmonbuild
docker container rm sdmonbuild
docker image rm ogi-it/sdmon:latest
12 changes: 6 additions & 6 deletions publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ e37c12e refs/tags/v1.0.9^{}
- lightweight tags only ??`git push --tags`
- or equivalent via GUI (whatever this way do...)

- Or even better we use versiontag (modified!) from https://github.com/franiglesias/versiontag
- `./versiontag current` -> show current version
- `./versiontag patch` -> patch
- `./versiontag minor` -> minor
- `./versiontag major` -> major
- Or even better we use versiontag (modified! to versiontag.sh) from https://github.com/franiglesias/versiontag
- `./versiontag.sh current` -> show current version
- `./versiontag.sh patch` -> patch
- `./versiontag.sh minor` -> minor
- `./versiontag.sh major` -> major

- TODO better sh script check if everything is commited before doing patch, minor, major
- created publish.sh script to check if everything is committed before doing versioning and build

- On the github action runner `github describe` works, but the `-dirty` flag doesn't. The `--abbrev=0` flag doesn't work either.
4 changes: 3 additions & 1 deletion versiontag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ if [[ false == "$force" && "no" == $(confirm "Do you agree?") ]]; then
fi

if [[ -z $msg ]]; then
execute git tag "v$major.$minor.$patch"
# execute git tag "v$major.$minor.$patch"
# ogi: changed to suite my needs: ALWAYS make an annotated tag!!
execute git tag -a "v$major.$minor.$patch" -m "releasing v$major.$minor.$patch"
else
printf 'Message : %s\n\n' "$msg"
execute git tag -a "v$major.$minor.$patch" -m "$msg ($action version)"
Expand Down

0 comments on commit 7bba09a

Please sign in to comment.