Snoweuph
a3429390fc
Some checks failed
Quality Check / Validate OAS (push) Successful in 38s
Build Application / build (push) Successful in 1m5s
Build Application / release (push) Has been cancelled
Build Application / build-docker (push) Has been cancelled
Quality Check / Testing (push) Successful in 47s
Quality Check / Linting (push) Successful in 1m2s
Quality Check / Static Analysis (push) Successful in 57s
96 lines
3 KiB
YAML
96 lines
3 KiB
YAML
name: Build Application
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?'
|
|
- "v*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: stable
|
|
container:
|
|
image: git.euph.dev/actions/runner-java-21:latest
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: "https://git.euph.dev/actions/checkout@v3"
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
- name: "Prepare Gradle"
|
|
run: gradle clean
|
|
- name: "Build Jar"
|
|
run: gradle bootJar -Pversion=${{ github.ref_name }}
|
|
- name: Upload Jar as Artifact
|
|
uses: "https://git.euph.dev/actions/upload-artifact@v3"
|
|
with:
|
|
name: tower_defence_server.jar
|
|
path: build/libs/Tower-Defence-Server-${{ github.ref_name }}.jar
|
|
- name: Upload API Spec as Artifact
|
|
uses: "https://git.euph.dev/actions/upload-artifact@v3"
|
|
with:
|
|
name: api.yml
|
|
path: api/api.yml
|
|
- name: "Stop Gradle"
|
|
run: gradle --stop
|
|
|
|
build-docker:
|
|
runs-on: docker
|
|
needs:
|
|
- build
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: "https://git.euph.dev/actions/checkout@v3"
|
|
- name: Download artifact from previous job
|
|
uses: "https://git.euph.dev/actions/download-artifact@v3"
|
|
with:
|
|
name: tower_defence_server.jar
|
|
path: .forgejo/workflows/
|
|
- name: Login to Registry
|
|
uses: "https://git.euph.dev/actions/docker-login@v3"
|
|
with:
|
|
registry: git.euph.dev
|
|
username: ${{ secrets.DEPLOY_USER }}
|
|
password: ${{ secrets.DEPLOY_SECRET }}
|
|
- name: Build and push Web Image
|
|
uses: "https://git.euph.dev/actions/docker-build-push@v5"
|
|
with:
|
|
context: ".forgejo/workflows/"
|
|
push: true
|
|
build-args: VERSION=${{ github.ref_name }}
|
|
tags: |
|
|
git.euph.dev/towerdefence/server:${{ github.ref_name }}
|
|
${{ contains(github.ref_name, 'rc') == false && 'git.euph.dev/towerdefence/server:latest' || '' }}
|
|
|
|
release:
|
|
runs-on: stable
|
|
container:
|
|
image: git.euph.dev/actions/runner-basic:latest
|
|
needs:
|
|
- build
|
|
- build-docker
|
|
steps:
|
|
- name: Download Server Jar
|
|
uses: "https://git.euph.dev/actions/download-artifact@v3"
|
|
with:
|
|
name: tower_defence_server.jar
|
|
path: release
|
|
- name: Create Release
|
|
uses: "https://git.euph.dev/actions/release@v2"
|
|
with:
|
|
direction: upload
|
|
tag: ${{ github.ref_name }}
|
|
token: ${{ secrets.DEPLOY_TOKEN }}
|
|
prerelease: ${{ contains( github.ref_name, "rc") }}
|
|
release-dir: release
|
|
release-notes: |
|
|
# Tower Defence - Server ${{ github.ref_name }}
|
|
Read the [Documentation](https://git.euph.dev/TowerDefence/Dokumentation/wiki/Server/Config) to see how to setup the server.
|
|
|
|
|
|
|