Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Dec 27, 2023
1 parent 1793b59 commit c895b3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/draft_nightly_nanocl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ jobs:
run: |
gh release delete-asset -y \
$BINARY_NAME-$VERSION-$CHANNEL \
${BINARY_NAME}_${VERSION}_amd64.deb \
${BINARY_NAME}_${VERSION}_amd64.deb
gh release delete-asset -y \
$BINARY_NAME-$VERSION-$CHANNEL \
${BINARY_NAME}_${VERSION}_amd64.tar.gz || true
gh release upload \
$BINARY_NAME-$VERSION-$CHANNEL \
target/debian/${BINARY_NAME}_${VERSION}_amd64.deb#nanocl_amd64.deb
gh release upload \
$BINARY_NAME-$VERSION-$CHANNEL \
target/linux/${BINARY_NAME}_${VERSION}_amd64.tar.gz#nanocl_amd64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
28 changes: 15 additions & 13 deletions .github/workflows/publish_nightly_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,23 @@ jobs:
echo $VERSION
# Create buildx multiarch
- name: Create buildx multiarch
run: docker buildx create --use --name=buildx-multi-arch --driver=docker-container --driver-opt=network=host
run: |
docker buildx create \
--use --name=buildx-multi-arch \
--driver=docker-container \
--driver-opt=network=host
# Build daemon image
- name: Build image
run: docker buildx build --builder=buildx-multi-arch --platform=linux/amd64,linux/arm/v7,linux/arm64 --build-arg channel=$CHANNEL --push --label org.opencontainers.image.source=https://github.com/next-hat/nanocl -t ghcr.io/next-hat/$BINARY_NAME:$VERSION-$CHANNEL -t ghcr.io/next-hat/$BINARY_NAME:$CHANNEL -f ./bin/$BINARY_NAME/Dockerfile .
# Export it as tar.gz
# - name: Export image
# run: docker save ghcr.io/next-hat/$BINARY_NAME:$VERSION-$CHANNEL | gzip > /tmp/$BINARY_NAME-$VERSION-$CHANNEL.tar.gz
run: |
docker buildx build \
--builder=buildx-multi-arch \
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
--build-arg channel=$CHANNEL \
--label org.opencontainers.image.source=https://github.com/next-hat/nanocl \
-t ghcr.io/next-hat/$BINARY_NAME:$VERSION-$CHANNEL \
-t ghcr.io/next-hat/$BINARY_NAME:$CHANNEL \
-f ./bin/$BINARY_NAME/Dockerfile . \
--push
# Upload it to release
- name: Test if release already exists
id: release-exists
Expand All @@ -69,13 +79,5 @@ jobs:
- name: Create new draft release
if: steps.release-exists.outcome == 'failure' && steps.release-exists.conclusion == 'success'
run: gh release create -t $BINARY_NAME-$VERSION-$CHANNEL -d $BINARY_NAME-$VERSION-$CHANNEL -F ./bin/$BINARY_NAME/changelog.md
# /tmp/$BINARY_NAME-$VERSION-$CHANNEL.tar.gz#$BINARY_NAME-image;
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
# - name: Update draft release
# if: steps.release-exists.outcome == 'success' && steps.release-exists.conclusion == 'success'
# run: |
# gh release delete-asset -y $BINARY_NAME-$VERSION-$CHANNEL $BINARY_NAME-$VERSION-$CHANNEL.tar.gz || true
# gh release upload $BINARY_NAME-$VERSION-$CHANNEL /tmp/$BINARY_NAME-$VERSION-$CHANNEL.tar.gz#$BINARY_NAME-image
# env:
# GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

0 comments on commit c895b3f

Please sign in to comment.