Skip to content

CI

CI #16

Workflow file for this run

name: CI
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
spksrc:
description: "branch"
required: false
type: string
version:
description: "format %y.%-m.$i or auto"
required: false
type: string
prerelease:
description: "pre release"
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- "x64-7.0"
- "aarch64-7.0"
steps:
- name: Checkout
uses: actions/checkout@main
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16"
cache: "npm"
cache-dependency-path: rr-manager/package-lock.json
- name: Checkout SynoCommunity Source and Docker Image
run: |
docker pull ghcr.io/synocommunity/spksrc
git clone --depth=1 https://github.com/SynoCommunity/spksrc.git
if [ -n "${{ inputs.spksrc }}" ]; then
cd spksrc
git fetch --depth=1 origin "${{ inputs.spksrc }}"
git checkout "${{ inputs.spksrc }}"
cd ..
fi
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Build Package
run: |
ROOT_PATH="${{ github.workspace }}"
docker run -v ${ROOT_PATH}/spksrc:/spksrc -v ${ROOT_PATH}/rr-manager:/spksrc/spk/rr-manager -w /spksrc/spk/rr-manager ghcr.io/synocommunity/spksrc make arch-${{ matrix.target }}
docker run -v ${ROOT_PATH}/spksrc:/spksrc -w /spksrc/spk/python311 ghcr.io/synocommunity/spksrc make arch-${{ matrix.target }}
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.target }}
path: |
spksrc/packages/*.spk
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: packages/*.spk
- name: Release
if: env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: |
spksrc/packages/*.spk