CI #9704
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Currently Windows only validates Java LTS version | |
# Send the coverage of Java LTS version on Linux to Cadacy | |
name: CI | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
- edited | |
schedule: | |
- cron: '16 11 * * 1' | |
env: | |
## LANG: "C" | |
## LC_CTYPE: "en_US.UTF-8" | |
LC_ALL: "C.UTF-8" | |
jobs: | |
########################################################################## | |
pre_job: | |
name: Duplicate actions check | |
# continue-on-error: true # Uncomment once integration is finished | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
# All of these options are optional, so you can remove them if you are happy with the defaults | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
paths_ignore: '["**/README.md", "**/CHANGELOG.md"]' | |
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | |
########################################################################## | |
analyze: | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' && github.event_name == 'pull_request' }} | |
name: Analyze with CodeQL | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ 'java', 'javascript' ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Set up java | |
if: contains(matrix.language, 'java') | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Compile with Maven | |
run: mvn clean compile -Dmaven.test.skip=true -Dpmd.skip=true -Pjetty-embed -Prelease17 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
########################################################################## | |
verify-Java17: | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
name: JDK17 on ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Set up ffmpeg | |
id: ffmpeg | |
uses: FedericoCarboni/setup-ffmpeg@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Create coverage | |
id: create-coverage | |
if: contains(matrix.os, 'ubuntu-latest') | |
run: mvn -Punit-test -Psend-coverage -Ptomcat-embed -DfailIfNoTests=false -DtranscodePath="${{ steps.ffmpeg.outputs.path }}" clean test jacoco:report | |
- name: Archive code coverage | |
if: "(steps.create-coverage.conclusion == 'success' && contains(matrix.os, 'ubuntu-latest')) && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Code coverage report | |
path: jpsonic-main/target/site/jacoco | |
retention-days: 7 | |
- name: Verify with Maven on Win | |
if: contains(matrix.os, 'windows-latest') | |
run: mvn -DfailIfNoTests=false -DtranscodePath="${{ steps.ffmpeg.outputs.path }}" clean verify -B -Ptomcat-embed -Punit-test | |
########################################################################## | |
verify-Java21-or-later: | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
name: JDK${{ matrix.java }} on ubuntu-latest | |
strategy: | |
matrix: | |
java: [ 21, 22 ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Set up ffmpeg | |
id: ffmpeg | |
uses: FedericoCarboni/setup-ffmpeg@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Verify with Maven | |
env: | |
NVD_API_KEY: ${{ secrets.NVD_API_KEY }} | |
run: mvn -DnvdApiKey=$NVD_API_KEY -DnvdApiDelay=3000 -DnvdMaxRetryCount=10 -DtranscodePath="${{ steps.ffmpeg.outputs.path }}" clean verify -B -Ptomcat-embed -Prelease${{ matrix.java }} -Punit-test | |
########################################################################## | |
send-coverage: | |
name: Send coverage to Codacy | |
needs: [ verify-Java17 ] | |
if: "(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')" | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
GITHUB_SHA: ${{ github.sha }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- name: Download coverage | |
uses: actions/download-artifact@v4 | |
with: | |
name: Code coverage report | |
- name: Send Jacoco report | |
run: mvn -Psend-coverage com.gavinmogan:codacy-maven-plugin:coverage | |
########################################################################## | |
ship-war: | |
if: "(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') && github.event_name != 'schedule'" | |
needs: [ verify-Java17, verify-Java21-or-later ] | |
name: Package with JDK ${{ matrix.java }} on ubuntu | |
strategy: | |
matrix: | |
java: [ 17, 21 ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Configure GPG Key | |
env: | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
run: | | |
mkdir -p ~/.gnupg/ | |
chmod 700 ~/.gnupg | |
printf "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key | |
chmod 600 ~/.gnupg/* | |
gpg --quiet --import ~/.gnupg/private.key | |
- name: Create jetty.war | |
run: | | |
mvn clean package -Dmaven.test.skip=true -Dpmd.skip=true -Pjetty-embed -Prelease${{ matrix.java }} | |
gpg2 --clearsign jpsonic-main/target/artifacts-checksums.sha | |
- name: Copy README | |
# Due to the specifications of actions/upload-artifact@v2. | |
# When loading different hierarchies of artifacts, each directory is created. | |
run: cp install/keys/README.txt jpsonic-main/target | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Archive artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk${{ matrix.java }}-${{ steps.date.outputs.current }} | |
path: | | |
jpsonic-main/target/jpsonic.war | |
jpsonic-main/target/artifacts-checksums.sha.asc | |
jpsonic-main/target/README.txt | |
retention-days: 90 | |
########################################################################## | |
ship-docker-image: | |
name: Docker(alpine-amd, arm) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk21-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/alpine/target/dependency | |
mv jpsonic.war install/docker/alpine/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/alpine | |
sed -i -e "s/21-jdk-alpine/21-jre-alpine/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=${{ env.DOCKER_TAG }} package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }} . | |
mvn -DdockerTag=${DOCKER_TAG%.*} package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*} . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*} package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*} . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/alpine | |
sed -i -e "s/21-jdk-alpine/21-jre-alpine/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:latest . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/alpine | |
sed -i -e "s/21-jdk-alpine/21-jre-alpine/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }} . | |
fi | |
- name: Release with Early-Access Tag | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/docker' | |
run: | | |
cd install/docker/alpine | |
mvn -DdockerTag=ea package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:ea . | |
########################################################################## | |
ship-docker-image-ubi9: | |
name: Docker(ubi9-amd) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk21-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/ubi9/target/dependency | |
mv jpsonic.war install/docker/ubi9/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/ubi9 | |
sed -i -e "s/21-jdk-ubi9-minimal/21-jre-ubi9-minimal/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=${{ env.DOCKER_TAG }}-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-ubi9 . | |
mvn -DdockerTag=${DOCKER_TAG%.*}-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:${DOCKER_TAG%.*}-ubi9 . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*}-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*}-ubi9 . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/ubi9 | |
sed -i -e "s/21-jdk-ubi9-minimal/21-jre-ubi9-minimal/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:latest-ubi9 . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/ubi9 | |
sed -i -e "s/21-jdk-ubi9-minimal/21-jre-ubi9-minimal/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-ubi9 . | |
fi | |
- name: Release with Early-Access Tag | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/docker' | |
run: | | |
cd install/docker/ubi9 | |
mvn -DdockerTag=ea-ubi9 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64 -t jpsonic/jpsonic:ea-ubi9 . | |
########################################################################## | |
ship-docker-image-noble: | |
name: Docker(noble-amd,arm) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk21-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/noble/target/dependency | |
mv jpsonic.war install/docker/noble/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/noble | |
sed -i -e "s/21-jdk-noble/21-jre-noble/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=${{ env.DOCKER_TAG }}-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-noble . | |
mvn -DdockerTag=${DOCKER_TAG%.*}-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*}-noble . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*}-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*}-noble . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/noble | |
sed -i -e "s/21-jdk-noble/21-jre-noble/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:latest-noble . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/noble | |
sed -i -e "s/21-jdk-noble/21-jre-noble/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-noble . | |
fi | |
- name: Release with Early-Access Tag | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/docker' | |
run: | | |
cd install/docker/noble | |
mvn -DdockerTag=ea-noble package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:ea-noble . | |
########################################################################## | |
ship-docker-image-noble-v7: | |
name: Docker(noble-arm/v7) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk17-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/armv7/target/dependency | |
mv jpsonic.war install/docker/armv7/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
mvn -DdockerTag=${{ env.DOCKER_TAG }}-noble-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-noble-v7 . | |
mvn -DdockerTag=${DOCKER_TAG%.*}-noble-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${DOCKER_TAG%.*}-noble-v7 . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*}-noble-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*}-noble-v7 . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
mvn -DdockerTag=latest-noble-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:latest-noble-v7 . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
mvn -DdockerTag=latest-noble-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-noble-v7 . | |
fi | |
########################################################################## | |
ship-docker-image-jammy: | |
name: Docker(jammy-amd,arm) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk21-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/jammy/target/dependency | |
mv jpsonic.war install/docker/jammy/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/jammy | |
sed -i -e "s/21-jdk-jammy/21-jre-jammy/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=${{ env.DOCKER_TAG }}-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-jammy . | |
mvn -DdockerTag=${DOCKER_TAG%.*}-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*}-jammy . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*}-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*}-jammy . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/jammy | |
sed -i -e "s/21-jdk-jammy/21-jre-jammy/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:latest-jammy . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/jammy | |
sed -i -e "s/21-jdk-jammy/21-jre-jammy/g" Dockerfile | |
sed -i -e "s/EXPOSE 3333/#EXPOSE 3333/g" Dockerfile | |
mvn -DdockerTag=latest-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-jammy . | |
fi | |
- name: Release with Early-Access Tag | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/docker' | |
run: | | |
cd install/docker/jammy | |
mvn -DdockerTag=ea-jammy package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t jpsonic/jpsonic:ea-jammy . | |
########################################################################## | |
ship-docker-image-jammy-v7: | |
name: Docker(jammy-arm/v7) | |
needs: ship-war | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Get current date | |
id: date | |
run: echo "current=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: jpsonic-jetty-embedded-for-jdk17-${{ steps.date.outputs.current }} | |
- name: Create Tag | |
run: | | |
echo "DOCKER_TAG=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Copy artifact | |
run: | | |
mkdir -p install/docker/armv7/target/dependency | |
mv jpsonic.war install/docker/armv7/target/dependency | |
- name: Release with Version Tag | |
if: "(github.ref == 'refs/heads/master')" | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
sed -i -e "s/17-jre-noble/17-jre-jammy/g" Dockerfile | |
mvn -DdockerTag=${{ env.DOCKER_TAG }}-jammy-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-jammy-v7 . | |
mvn -DdockerTag=${DOCKER_TAG%.*}-jammy-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${DOCKER_TAG%.*}-jammy-v7 . | |
mvn -DdockerTag=${DOCKER_TAG%.*.*}-jammy-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${DOCKER_TAG%.*.*}-jammy-v7 . | |
fi | |
- name: Release with Latest Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
sed -i -e "s/17-jre-noble/17-jre-jammy/g" Dockerfile | |
mvn -DdockerTag=latest-jammy-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:latest-jammy-v7 . | |
fi | |
- name: Release with Alpha/Beta Tag | |
if: github.ref == 'refs/heads/master' | |
run: | | |
if [[ ${{ env.DOCKER_TAG }} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.(alpha|beta)\.[0-9]+\.[0-9]+$ ]]; then | |
cd install/docker/armv7 | |
sed -i -e "s/17-jre-noble/17-jre-jammy/g" Dockerfile | |
mvn -DdockerTag=latest-jammy-v7 package | |
docker import target/docker/jpsonic/jpsonic/tmp/docker-build.tar | |
docker buildx build --push --platform linux/arm/v7 -t jpsonic/jpsonic:${{ env.DOCKER_TAG }}-jammy-v7 . | |
fi | |
########################################################################## | |
run-docker4latest: | |
name: Run ${{ matrix.tag }} | |
needs: [ ship-docker-image, ship-docker-image-ubi9, ship-docker-image-noble, ship-docker-image-noble-v7, ship-docker-image-jammy, ship-docker-image-jammy-v7 ] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tag: [ latest, latest-ubi9, latest-noble, latest-jammy ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Boot test for ea (Within 30 sec) | |
run: | | |
mkdir -p /tmp/${{ matrix.tag }} | |
cp install/docker/production.synology.yml /tmp/${{ matrix.tag }} | |
cd /tmp/${{ matrix.tag }} | |
mkdir -p /tmp/${{ matrix.tag }}/jpsonic/data /tmp/${{ matrix.tag }}/jpsonic/music /tmp/${{ matrix.tag }}/jpsonic/podcasts /tmp/${{ matrix.tag }}/jpsonic/playlists | |
sed -i -e "s/image: 'jpsonic\/jpsonic:latest'/image: 'jpsonic\/jpsonic:${{ matrix.tag }}'/g" production.synology.yml | |
sed -i -e "s/container_name: 'jpsonic'/container_name: 'jpsonic_${{ matrix.tag }}'/g" production.synology.yml | |
sed -i -e "s/\/c\/tmp\/jpsonic/\/tmp\/${{ matrix.tag }}\/jpsonic/g" production.synology.yml | |
cat production.synology.yml | |
set -x | |
docker compose -f production.synology.yml up -d | |
for i in {1..30};do sleep 1;curl http://localhost:4040/rest/ping&&break;done | |
########################################################################## | |
run-docker4ea: | |
name: Run ${{ matrix.tag }} | |
needs: [ ship-docker-image, ship-docker-image-ubi9, ship-docker-image-noble, ship-docker-image-noble-v7, ship-docker-image-jammy, ship-docker-image-jammy-v7 ] | |
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/feature/docker' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tag: [ ea, ea-ubi9, ea-noble, ea-jammy ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Boot test for ea (Within 30 sec) | |
run: | | |
mkdir -p /tmp/${{ matrix.tag }} | |
cp install/docker/production.synology.yml /tmp/${{ matrix.tag }} | |
cd /tmp/${{ matrix.tag }} | |
mkdir -p /tmp/${{ matrix.tag }}/jpsonic/data /tmp/${{ matrix.tag }}/jpsonic/music /tmp/${{ matrix.tag }}/jpsonic/podcasts /tmp/${{ matrix.tag }}/jpsonic/playlists | |
sed -i -e "s/image: 'jpsonic\/jpsonic:latest'/image: 'jpsonic\/jpsonic:${{ matrix.tag }}'/g" production.synology.yml | |
sed -i -e "s/container_name: 'jpsonic'/container_name: 'jpsonic_${{ matrix.tag }}'/g" production.synology.yml | |
sed -i -e "s/\/c\/tmp\/jpsonic/\/tmp\/${{ matrix.tag }}\/jpsonic/g" production.synology.yml | |
cat production.synology.yml | |
set -x | |
docker compose -f production.synology.yml up -d | |
for i in {1..30};do sleep 1;curl http://localhost:4040/rest/ping&&break;done |