Skip to content

Commit e11cba3

Browse files
committed
Release docker image
1 parent 477c4a9 commit e11cba3

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/release.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow is used for publishing the NuGet package and Docker image.
1+
# This workflow is used for publishing the binaries and Docker image.
22
#
33
# Before triggering a release the `semver.txt` file should be updated in the
44
# relevant branch.
@@ -42,12 +42,23 @@ jobs:
4242
run: |
4343
VERSION=`cat semver.txt`
4444
echo "##[set-output name=version;]$VERSION"
45+
REPO=cyclonedx/cyclonedx-cli
4546
dotnet build --configuration Release
4647
mkdir bin
4748
for runtime in linux-x64 linux-musl-x64 linux-arm linux-arm64 win-x64 win-x86 win-arm win-arm64 osx-x64
4849
do
4950
dotnet publish cyclonedx/cyclonedx.csproj -r $runtime --configuration Release --version-suffix $VERSION --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/$runtime
5051
done
52+
docker build -f Dockerfile --build-arg VERSION=$VERSION -t $REPO:$VERSION -t $REPO:latest .
53+
54+
- name: Publish Docker image to Docker Hub
55+
env:
56+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
57+
run: |
58+
REPO=cyclonedx/cyclonedx-cli
59+
docker login --username coderpatros --password "$DOCKER_TOKEN"
60+
docker push $REPO:latest
61+
docker push $REPO:${{ steps.create_binaries.outputs.version }}
5162
5263
- name: Create github release and git tag for release
5364
id: create_release

local-docker-build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env bash
22
dotnet publish cyclonedx/cyclonedx.csproj -r linux-x64 --configuration Release --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/linux-x64
3-
docker build . --tag cyclonedx/cyclonedx-cli
3+
docker build . --tag cyclonedx/cyclonedx-cli
4+
docker run cyclonedx/cyclonedx-cli

semver.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.3
1+
0.0.4

0 commit comments

Comments
 (0)