3535 release_upload_url : ${{ steps.create_release.outputs.upload_url }}
3636 steps :
373738+ - uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
38393940 with :
4041 dotnet-version : ' 8.0'
4748
4849 # Create binaries
4950 - name : Create binaries
51+ env :
52+ DOCKER_TOKEN : ${{ secrets.DOCKER_TOKEN }}
5053 id : create_binaries
5154 run : |
5255 VERSION=`cat semver.txt`
@@ -58,16 +61,21 @@ jobs:
5861 do
5962 dotnet publish src/cyclonedx/cyclonedx.csproj -r $runtime --configuration Release /p:Version=$VERSION --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output bin/$runtime
6063 done
61- docker build --sbom=true --provenance mode=max,builder-id="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" --annotation "org.opencontainers.image.url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" --annotation "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" --annotation "org.opencontainers.image.version=$VERSION" --annotation "org.opencontainers.image.revision=$GITHUB_SHA" --annotation "org.opencontainers.image.created=$(date -Iseconds)" -f Dockerfile --build-arg VERSION=$VERSION -t $REPO:$VERSION -t $REPO:latest .
62-
63- - name : Publish Docker image to Docker Hub
64- env :
65- DOCKER_TOKEN : ${{ secrets.DOCKER_TOKEN }}
66- run : |
67- REPO=cyclonedx/cyclonedx-cli
64+
6865 docker login --username coderpatros --password "$DOCKER_TOKEN"
69- docker push $REPO:latest
70- docker push $REPO:${{ steps.create_binaries.outputs.version }}
66+ docker buildx build \
67+ --sbom=true \
68+ --provenance mode=max,builder-id="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
69+ --annotation "org.opencontainers.image.url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
70+ --annotation "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
71+ --annotation "org.opencontainers.image.version=$VERSION" \
72+ --annotation "org.opencontainers.image.revision=$GITHUB_SHA" \
73+ --annotation "org.opencontainers.image.created=$(date -Iseconds)" \
74+ --build-arg VERSION=$VERSION \
75+ -t $REPO:$VERSION \
76+ -t $REPO:latest \
77+ --push \
78+ -f Dockerfile .
7179
7280 - name : Create github release and git tag for release
7381 id : create_release
0 commit comments