Skip to content

chore: release nightly 0.5.4 #5

chore: release nightly 0.5.4

chore: release nightly 0.5.4 #5

name: Publish nightly
on:
push:
branches:
- "release/nightly/**"
pull_request:
branches:
- "release/nightly/**"
types: [opened, synchronize]
env:
CARGO_TERM_COLOR: always
jobs:
release_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# Set buildx cache
- name: Cache register
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: buildx-cache
# Login to ghcr.io
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_TOKEN }}
# Extract branch info
- name: Set info
run: |
echo "CHANNEL=$(echo ${GITHUB_REF} | awk -F/ '{print $4}')" >> $GITHUB_ENV
echo "VERSION=$(echo ${GITHUB_REF} | awk -F/ '{print $5}')" >> $GITHUB_ENV
# Print info for debug
- name: Print Info
run: |
echo $CHANNEL
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
# Build daemon image
- name: Build image
run: |
docker buildx build \
--builder=buildx-multi-arch \
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
--label org.opencontainers.image.source="https://github.com/next-hat/metrs" \
-t ghcr.io/next-hat/metrsd:$VERSION-$CHANNEL \
-t ghcr.io/next-hat/metrsd:$CHANNEL \
-f ./Dockerfile . \
--push
# Upload it to release
- name: Test if release already exists
id: release-exists
continue-on-error: true
run: gh release view $VERSION-$CHANNEL
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Create new draft release
if: steps.release-exists.outcome == 'failure' && steps.release-exists.conclusion == 'success'
run: gh release create -t $VERSION-$CHANNEL -d $VERSION-$CHANNEL -F ./bin/metrsd/CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}