Skip to content

Commit 316f2fb

Browse files
committed
CI. Add ESOUI upload
1 parent 87bc997 commit 316f2fb

2 files changed

Lines changed: 31 additions & 27 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,20 @@ env:
1515

1616
jobs:
1717
release:
18-
name: "release"
18+
name: "Make release"
1919
runs-on: ubuntu-latest
20-
permissions: write-all
2120
steps:
2221
- name: Check out repository
2322
uses: actions/checkout@v4
2423

25-
- name: Get addon variables
24+
- name: Set version variables
2625
run: |
2726
version=$(echo "${{ github.ref_name }}" | sed -e 's/[^[:alnum:]._-]/-/g')
2827
2928
echo "ADDON_VERSION=$version" >> $GITHUB_ENV
3029
echo "ADDON_ZIP_NAME=${{ env.ADDON_NAME }}-$version.zip" >> $GITHUB_ENV
3130
32-
33-
- name: Replace placeholders in addon files
31+
- name: Update version in files
3432
run: |
3533
cd ${{ env.ADDON_NAME }}
3634
@@ -62,38 +60,41 @@ jobs:
6260
run: |
6361
zip -r --quiet "$(pwd)/${{ env.ADDON_ZIP_NAME }}" "${{ env.ADDON_NAME }}"
6462
65-
- name: Extract latest changelog entry
63+
- name: Upload build artifacts
64+
if: ${{ github.ref_type != 'tag' }}
65+
uses: actions/upload-artifact@v4
66+
with:
67+
path: ${{ env.ADDON_ZIP_NAME }}
68+
retention-days: 3
69+
70+
- name: Extract latest changes for GitHub Release
71+
if: ${{ github.ref_type == 'tag' }}
6672
run: |
6773
awk '/^## / { if (!found) { found=1; print; next } else { exit } } found' CHANGELOG.md > latest_changes.md
6874
cat latest_changes.md
6975
7076
- name: Create GitHub Release
71-
uses: ncipollo/release-action@v1
7277
if: ${{ github.ref_type == 'tag' }}
78+
uses: ncipollo/release-action@v1
7379
with:
7480
name: "${{ env.ADDON_VERSION }}"
7581
artifacts: "${{ env.ADDON_ZIP_NAME }}"
7682
artifactContentType: application/zip
7783
bodyFile: latest_changes.md
78-
prerelease: true
7984
makeLatest: true
8085

81-
- name: Upload artifact
82-
uses: actions/upload-artifact@v4
83-
if: ${{ github.ref_type != 'tag' }}
84-
with:
85-
path: ${{ env.ADDON_ZIP_NAME }}
86-
87-
retention-days: 3
88-
# - name: Send to ESOUI
89-
# env:
90-
# ESOUI_API_KEY: ${{ secrets.ESOUI_API_KEY }}
91-
# ADDON_ID: 2311
92-
# run: |
93-
# curl -X POST \
94-
# -H "x-api-token: $ESOUI_API_KEY" \
95-
# -F "id=${ADDON_ID}" \
96-
# -F "version=${{ env.ADDON_VERSION }}" \
97-
# -F "updatefile=@${{ env.ADDON_ZIP_NAME }}" \
98-
# -F "changelog=$(cat CHANGELOG.md)" \
99-
# https://api.esoui.com/addons/update
86+
- name: Upload to ESOUI
87+
if: ${{ github.ref_type == 'tag' }}
88+
env:
89+
addon_id: ${{ vars.ESOUI_ADDON_ID }}
90+
api_key: ${{ secrets.ESOUI_API_KEY }}
91+
addon_version: ${{ env.ADDON_VERSION }}
92+
addon_zip: ${{ env.ADDON_ZIP_NAME }}
93+
run: |
94+
curl --fail -X POST \
95+
-H "x-api-token: $api_key" \
96+
-F "id=$addon_id" \
97+
-F "version=$addon_version" \
98+
-F "updatefile=@$addon_zip" \
99+
-F "changelog=$(cat CHANGELOG.md)" \
100+
https://api.esoui.com/addons/update

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.1.2 2025.04.14
2+
- Add CI action for ESOUI upload
3+
14
## 1.1.1 2025.04.14
25
- Update DependsOn LibAddonMenu version.
36
- Update global strings.

0 commit comments

Comments
 (0)