Skip to content

ESO Addon Release

ESO Addon Release #25

Workflow file for this run

name: ESO Addon Release
# Auslöser: Bei einem Pull Request auf die master-Branch von development oder manueller dispatch
on:
pull_request:
branches:
- master
types:
- closed
workflow_dispatch:
jobs:
build:
if: (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'development') || (github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: 'barnysCCTracker'
- name: Extract API Version and Addon Version
id: version_info
run: |
APIVersion=$(grep -Po '(?<=## APIVersion: )\d+' barnysCCTracker/barnysCCTracker.txt)
AddonVersion=$(grep -Po '(?<=## Version: )[\d.]+' barnysCCTracker/barnysCCTracker.txt)
echo "API_VERSION=$APIVersion" >> $GITHUB_ENV
echo "ADDON_VERSION=$AddonVersion" >> $GITHUB_ENV
- name: Get Compatible Patch ID
id: get_patch_id
run: |
# Hole die aktuelle Patchnummer
PatchVersion=$(grep -Po '(?<=## APIVersion: )\d+' barnysCCTracker/barnysCCTracker.txt)
# Anfrage an die ESOUI API, um die ID für die Patch-Version zu erhalten
PatchID=$(curl -s -H "x-api-token: ${{ secrets.ESOUI_API_TOKEN }}" "https://api.esoui.com/addons/compatible.json" | jq -r ".[] | select(.interface == \"$PatchVersion\") | .id")
echo "PATCH_ID=$PatchID" >> $GITHUB_ENV
- name: Extract Changelog
id: changelog
run: |
Changelog=$(cat barnysCCTracker/Changelog.txt)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$Changelog" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Replace Semicolons in Addon Description
id: fix_description
run: |
Description=$(cat barnysCCTracker/README.md)
# Ersetze Semikolons durch HTML-Entity
DescriptionFixed=$(echo "$Description" | sed 's/;/&semi;/g')
echo "DESCRIPTION_FIXED=$DescriptionFixed" >> $GITHUB_ENV
- name: Zip Addon Files (excluding .gitattributes)
run: 7z a barnysCCTracker.zip barnysCCTracker/* -xr!*.git*
# - name: Create GitHub Release
# uses: softprops/action-gh-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.CREATE_RELEASE_TOKEN }}
# with:
# tag_name: ${{ env.ADDON_VERSION }}
# name: Release ${{ env.ADDON_VERSION }}
# body: ${{ env.CHANGELOG }}
# draft: false
# prerelease: false
- name: Upload Addon to ESOUI
run: |
curl \
-H "x-api-token: ${{ secrets.ESOUI_API_TOKEN }}" \
-F "id=3971" \
-F "version=${{ env.ADDON_VERSION }}" \
-F "updatefile=@./barnysCCTracker.zip" \
-F "changelog=${{ env.CHANGELOG }}" \
-F "compatible=${{ env.PATCH_ID }}" \
-F "description=${{ env.DESCRIPTION_FIXED }}" \
https://api.esoui.com/addons/updatetest