Files
schafkopf-bot/.github/workflows/relaseNewVersion.yml
2024-04-17 01:57:25 +02:00

68 lines
1.5 KiB
YAML

name: Release new Version
permissions:
contents: write
on:
push:
branches:
- 'master'
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
name: Build and Release
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Frontend dependencies
run: npm install
working-directory: Frontend
- name: Create .env file
run: echo "VITE_APP_WEBSOCKET_IP=localhost" > .env
working-directory: Frontend
- name: Build Frontend
run: npm run build
working-directory: Frontend
- name: Copy built Frontend
run: rm -r Backend/src/main/resources/web-content/ && mv Frontend/dist Backend/src/main/resources/web-content
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.8.2
- name: Build Backend
run: mvn -B package --file pom.xml
working-directory: Backend
- name: Archive dist folder
run: mv Backend/target/schafkopf-backend-build-jar-with-dependencies.jar schafkopf-bot.jar && zip -r dist.zip schafkopf-bot.jar
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist.zip
token: ${{ secrets.PAT }}