Skip to content

eula api (#259)

eula api (#259) #960

Workflow file for this run

name: CI
on:
push:
branches:
- main
- dev-*
tags:
- v*
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { platform: macos-14, arch: arm64, os: macos }
- { platform: macos-13, arch: x64, os: macos }
- { platform: ubuntu-20.04, arch: x64, os: linux }
- { platform: ubuntu-20.04, arch: arm32, os: linux }
- { platform: windows-2019, arch: x64, os: windows }
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MinGW64
if: matrix.os == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
install: >-
mingw-w64-x86_64-gcc
- name: Setup go compiler
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: false
- name: Setup zig
if: matrix.os == 'linux' && matrix.arch == 'arm32'
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.11.0
- name: Install Neo Web
run: go run mage.go InstallNeoWeb
- name: Install Neo Launcher
if: matrix.os == 'macos' || matrix.os == 'windows'
run: go run mage.go InstallNeoLauncher
- name: Build
if: matrix.arch != 'arm32'
run: go run mage.go test machbase-neo
- name: Build arm32
if: matrix.arch == 'arm32'
run: go run mage.go buildx machbase-neo linux arm packagex linux arm
- name: Codecov
if: matrix.os == 'linux' && matrix.arch == 'x64'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Codesign and notarize macos app
if: matrix.os == 'macos'
uses: toitlang/[email protected]
with:
certificate: ${{ secrets.CODESIGN_DARWIN_CERTIFICATE }}
certificate-password: ${{ secrets.CODESIGN_DARWIN_PASS }}
username: ${{ secrets.CODESIGN_DARWIN_APPLE_ID_USERNAME }}
password: ${{ secrets.CODESIGN_DARWIN_APPLE_ID_PASS }}
apple-team-id: ${{ secrets.CODESIGN_DARWIN_APPLE_TEAM_ID }}
app-path: |-
./tmp/machbase-neo
- name: Codesign windows app
if: matrix.os == 'windows'
uses: dlemstra/code-sign-action@v1
with:
certificate: ${{ secrets.CODESIGN_WIN_CERTIFICATE }}
password: ${{ secrets.CODESIGN_WIN_PASS }}
folder: './tmp'
recursive: false
files: |
machbase-neo.exe
- name: Package
if: matrix.arch != 'arm32'
run: go run mage.go package
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') != true
uses: actions/upload-artifact@v4
with:
name: machbase-neo-snapshot-${{ matrix.os }}-${{ matrix.arch }}
retention-days: 5
path: packages/machbase-neo-v*.zip
- name: Release files
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GIT_PASS }}
file: packages/machbase-neo-v*.zip
repo_name: machbase/neo-server
prerelease: true
tag: ${{ github.ref }}
overwrite: true
file_glob: true
linux-arm64:
runs-on: [ self-hosted, linux, arm64, ubuntu20 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup go compiler
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: false
cache: false # !!! do not cache for self-hosted runner
- name: Install Neo Web
run: go run mage.go InstallNeoWeb
- name: Build
run: go run mage.go test machbase-neo
- name: Package
run: go run mage.go package
- name: Upload Artifact
if: startsWith(github.ref, 'refs/tags/v') != true
uses: actions/upload-artifact@v4
with:
name: machbase-neo-snapshot-linux-arm64
retention-days: 5
path: packages/machbase-neo-v*.zip
- name: Release files
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GIT_PASS }}
file: packages/machbase-neo-v*.zip
repo_name: machbase/neo-server
prerelease: true
tag: ${{ github.ref }}
overwrite: true
file_glob: true
docker-arm64:
runs-on: [ self-hosted, linux, ARM64, ubuntu20 ]
if: startsWith(github.ref, 'refs/tags/v')
needs: [ build ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up go compiler
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: false
cache: false # do not cache for self-hosted runner
- name: Install Neo Web
run: go run mage.go InstallNeoWeb
- name: Package for arm64
run: |
go run mage.go machbase-neo && \
scp tmp/machbase-neo ${{ secrets.DOCKER_HOST }}:/home/ubuntu/docker-build/arm64/
docker-amd64:
runs-on: [ self-hosted, linux, X64, ubuntu20 ]
if: startsWith(github.ref, 'refs/tags/v')
needs: [ docker-arm64 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up go compiler
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: false
cache: false # do not cache for self-hosted runner
- name: Install Neo Web
run: go run mage.go InstallNeoWeb
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker version
run: docker -v
- name: Get Next Version
id: get_version
run: echo "ver=$(go run mage.go buildversion)" >> $GITHUB_OUTPUT
shell: bash
- name: Package for amd64
run: |
go run mage.go machbase-neo && \
mv tmp/machbase-neo /home/ubuntu/docker-build/amd64/
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build and Push (Latest)
uses: docker/build-push-action@v4
if: (!contains(github.ref, 'snapshot') && !contains(github.ref, 'rc'))
with:
context: /home/ubuntu/docker-build
file: ./scripts/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: |
machbase/machbase-neo:${{ steps.get_version.outputs.ver }}
machbase/machbase-neo:latest
- name: Docker Build and Push (Snapshot)
uses: docker/build-push-action@v4
if: (contains(github.ref, 'snapshot') || contains(github.ref, 'rc'))
with:
context: /home/ubuntu/docker-build
file: ./scripts/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: |
machbase/machbase-neo:${{ steps.get_version.outputs.ver }}