forked from kagemomiji/airsonic-advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (88 loc) · 3.15 KB
/
edge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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@v3
id: setup-ffmpeg
- name: Cache Maven packages
uses: actions/cache@v4
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@v2
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 }}