Merge pull request #341 from kagemomiji/issue340-bump-up-libraries #118
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
name: 'Edge Deploy CI (Maven)' | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- "**.md" | |
- "*.txt" | |
- ".github/**" | |
workflow_dispatch: | |
env: | |
DEFAULT_MUSIC_FOLDER: /tmp/music | |
EXCLUDED_TEST_GROUPS: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Setup ffmpeg | |
uses: FedericoCarboni/setup-ffmpeg@v2 | |
id: setup-ffmpeg | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-m2- | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- run: mkdir -p ${DEFAULT_MUSIC_FOLDER} | |
- name: Build with Maven | |
run: mvn -DexcludedGroups=${EXCLUDED_TEST_GROUPS} -Ddocker.testing.default-music-folder=${DEFAULT_MUSIC_FOLDER} verify -B -P integration-test | |
- name: Calculate tags | |
if: success() | |
id: tagcalc | |
run: | | |
# Create tag | |
ver=$(grep "version=" airsonic-main/target/generated/build-metadata/build.properties | cut -d"=" -f2); | |
ts=$(grep "timestamp=" airsonic-main/target/generated/build-metadata/build.properties | cut -d"=" -f2); | |
# Note this doesn't completely follow semver because docker tags do not take a + sign | |
tag=$ver\.$ts; | |
echo $tag; | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
- name: Deploy to GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tagcalc.outputs.tag }} | |
name: Edge Release ${{ steps.tagcalc.outputs.tag }} | |
draft: false | |
prerelease: true | |
generate_release_notes: true | |
files: | | |
airsonic-main/target/airsonic.war | |
airsonic-main/target/artifacts-checksums.sha | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push multiplatform images to Dockerhub | |
uses: docker/build-push-action@v5 | |
with: | |
file: install/docker/Dockerfile | |
context: install/docker | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
ghcr.io/kagemomiji/airsonic-advanced:latest | |
ghcr.io/kagemomiji/airsonic-advanced:edge-latest | |
ghcr.io/kagemomiji/airsonic-advanced:edge-${{ steps.tagcalc.outputs.tag }} | |
ghcr.io/kagemomiji/airsonic-advanced:gitcommit-${{ github.sha }} | |
ghcr.io/kagemomiji/airsonic-advanced:gitrun-${{ github.run_id }} |