Files
MusicBot/.gitea/workflows/build-and-test.yml
T
Miles WardandClaude Fable 5.1 e772eb7c2b
Build and Test / Build and Test (push) Canceled after 1m24s
Gitea copy: $uicide Music Bot — image, Unraid template, CI, publishing
Fork of purnell569/MusicBot 0.7.1 (JMusicBot), kept here as a reliable
copy with a container image built and served from this Gitea.

- README retitled "$uicide Music Bot"; lineage table, Gitea image, Unraid
  and release instructions. Nothing under src/ changes.
- Dockerfile: Maven stage on $BUILDPLATFORM (JAR is arch-neutral, so no
  QEMU for the build), OCI labels point at this repo and record commit and
  version via GIT_SHA/VERSION build args.
- docker/entrypoint.sh: check the data dir is writable up front (the bot's
  own error for that is a misleading "another instance is running"), and
  on a missing config.txt run the bot's generate-config and stop with
  instructions instead of prompting on a console that does not exist.
- deploy/unraid/musicbot.xml: Unraid template, --user 99:100 default.
- .gitea/workflows/build-and-test.yml: mvn verify + docker build on push;
  its presence makes Gitea ignore the GitHub-only workflows in .github/.
- scripts/build-and-publish-unraid.sh + docs/PUBLISHING.md: release
  runbook (keychain-safe registry push, release with zipped JAR).
- docker-compose.example.yml points at the Gitea image.

Upstream's v0.7.1 tag is preserved as upstream/v0.7.1; this repository's
own release tag v0.7.1 is on this commit.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-17 19:19:59 -04:00

61 lines
2.2 KiB
YAML

name: Build and Test
# Gitea Actions counterpart of upstream's GitHub workflow. Gitea reads
# .gitea/workflows first and ignores .github/workflows whenever this directory
# exists, so the GitHub-only workflows (ghcr.io publishing, Codecov upload)
# never run here. Everything executes inside containers, so the runner needs
# nothing but Docker. Publishing the image and cutting a release stay manual:
# see docs/PUBLISHING.md.
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'NOTICE'
- 'docs/**'
- 'deploy/**'
- '*.example.yml'
- '.github/**'
- '.circleci/**'
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
# The workspace is streamed in over stdin rather than bind-mounted, so
# this works whether the runner talks to a local daemon or a remote
# socket. A named volume keeps the Maven repository warm between runs.
- name: Maven verify (Java 25, unit + integration tests)
run: |
set -eu
COMMIT_TIME=$(git log -1 --format=%cI)
tar cf - --exclude=./.git --exclude=./target . | docker run --rm -i \
-v musicbot-ci-m2:/root/.m2 \
maven:3.9.12-eclipse-temurin-25-alpine \
sh -ec "mkdir -p /build && cd /build && tar xf - && mvn -B -ntp verify -Dproject.build.outputTimestamp=$COMMIT_TIME"
- name: Docker image builds and starts a JVM
run: |
set -eu
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\([^<]*\)<\/version>.*/\1/')
docker build --pull --provenance=false --sbom=false \
--build-arg "GIT_SHA=$(git rev-parse HEAD)" \
--build-arg "VERSION=$VERSION" \
--build-arg "BUILD_TIMESTAMP=$(git log -1 --format=%cI)" \
-t "musicbot-ci:${{ github.sha }}" .
docker run --rm --entrypoint java "musicbot-ci:${{ github.sha }}" -version
docker rmi "musicbot-ci:${{ github.sha }}"