Skip to content

release: v10.1.8

release: v10.1.8 #757

Workflow file for this run

on:
push:
tags:
- 'v*'
workflow_dispatch:
name: Release
permissions: write-all
env:
IMAGE: innei/mx-server
REDISMS_DISABLE_POSTINSTALL: 1
MONGOMS_DISABLE_POSTINSTALL: 1
jobs:
quality:
name: Lint & Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node
with:
node-version: '22.x'
- name: Run Lint
run: pnpm run lint
- name: Run Typecheck
run: pnpm run typecheck
build:
name: Core
runs-on: ubuntu-latest
needs: quality
services:
redis:
image: redis
ports:
- 6379:6379
mongo:
image: mongo
ports:
- 27017:27017
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node
with:
node-version: '22.x'
- name: Build project
run: |
pnpm run bundle
- name: Test Bundle Server
run: |
bash scripts/workflow/test-server.sh
- name: Zip Assets
run: |
sh apps/core/zip-asset.sh
mv release.zip release-linux.zip
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: ${{ contains(fromJSON('["alpha", "beta"]'), github.ref_name) }}
files: release-linux.zip
- name: Changelog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: Docker (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
needs: quality
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Copy .env
run: |
cp .env.example .env
- name: Build and load
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ${{ env.IMAGE }}
labels: ${{ steps.meta.outputs.labels }}
- name: Test
run: |
bash ./scripts/workflow/test-docker.sh
sudo rm -rf ./data
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
context: .
tags: ${{ env.IMAGE }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v6
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
name: Merge
runs-on: ubuntu-latest
needs: docker
steps:
- name: Download digests
uses: actions/download-artifact@v7
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
dokploy:
name: Trigger Dokploy Redeploy
runs-on: ubuntu-latest
needs: merge
env:
DOKPLOY_WEBHOOK_URL: ${{ secrets.DOKPLOY_WEBHOOK_URL }}
steps:
- name: Trigger Dokploy webhook
if: ${{ env.DOKPLOY_WEBHOOK_URL != '' }}
run: |
curl -sf -X POST "${{ env.DOKPLOY_WEBHOOK_URL }}" \
-H "Content-Type: application/json" \
-d "{\"source\":\"github-release\",\"tag\":\"${{ github.ref_name }}\"}"