initial commit of functioning opening tracking

This commit is contained in:
Sheldan
2024-01-06 23:29:25 +01:00
parent b72c68dfe5
commit 45e7982330
176 changed files with 37635 additions and 0 deletions

35
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Execute Build
on:
push:
branches:
- master
- feature/**
- hotfix/**
- bugfix/**
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 21
- name: Build with Maven
run: mvn -B install --file gw2-tools-backend/pom.xml
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: cd gw2-tools-ui && npm ci

86
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: Publishes a new version of the application
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 21
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install node dependencies and build
working-directory: ./gw2-tools-ui
run: npm ci
- name: Build ui application
working-directory: ./gw2-tools-ui
run: npm run build
- name: Copy built UI
run: cp -R gw2-tools-ui/build/* gw2-tools-frontend/resources
- name: Load current version
id: version
working-directory: ./gw2-tools-backend
run: echo "version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec | cut -d- -f1)" >> $GITHUB_ENV
- name: Release maven packages
uses: qcastel/github-actions-maven-release@v1.12.41
env:
JAVA_HOME: /usr/lib/jvm/java-21-openjdk/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
maven-project-folder: "gw2-tools-backend/"
git-release-bot-name: "release-bot"
git-release-bot-email: "release-bot@sheldan.dev"
release-branch-name: master
maven-args: "-Dmaven.javadoc.skip=true -s settings.xml -DskipTests"
access-token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Harbor
uses: docker/login-action@v2
with:
registry: harbor.sheldan.dev
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Update Chart version file
uses: fjogeleit/yaml-update-action@v0.13.2
with:
valueFile: 'ci/gw2-tools/Chart.yaml'
propertyPath: 'version'
value: ${{ env.version }}
commitChange: false
- name: Update .env version
run:
sed -i '2s/.*/VERSION=${{ env.version }}/' .env
- name: Update version in package.json
working-directory: ./gw2-tools-ui
run:
npm version ${{ env.version }}
- name: Load env file
id: dotenv
uses: falti/dotenv-action@v1.0.4
with:
path: .env
- name: Build and push Docker containers
run: docker-compose build && docker-compose push
env:
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
VERSION: ${{ steps.dotenv.outputs.version }}
- name: Helm package and push
working-directory: ./ci/
run: |-
helm registry login -u '${{ secrets.HARBOR_USERNAME }}' -p '${{ secrets.HARBOR_TOKEN }}' harbor.sheldan.dev
helm package gw2-tools
helm push gw2-tools*.tgz oci://harbor.sheldan.dev/gw2
- name: Fix file permissions
run:
sudo chmod -R ugo+rwX . # https://github.com/actions/checkout/issues/164
- name: Commit updated versions
uses: EndBug/add-and-commit@v9
with:
author_name: "release-bot"
author_email: "release-bot@sheldan.dev"