Skip to content

Commit 96081ea

Browse files
committed
ci: automate Nexus Mods uploads
1 parent 035b4ca commit 96081ea

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/nexus-upload.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Upload latest release to Nexus Mods
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
nexus:
11+
name: Upload to Nexus Mods
12+
environment: nexusmods
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Download latest GitHub release
17+
env:
18+
GH_REPO: ${{ github.repository }}
19+
GH_TOKEN: ${{ github.token }}
20+
shell: bash
21+
run: |
22+
set -euo pipefail
23+
24+
tag="$(gh release view --json tagName --jq .tagName)"
25+
gh release download "$tag" --pattern BigBankBoxPatternHelper.zip
26+
echo "version=${tag#v}" >> "$GITHUB_ENV"
27+
28+
- name: Upload to Nexus Mods
29+
uses: Nexus-Mods/upload-action@c96019556046053aa26044b44396cd38929daf23 # v1.0.0-beta.10
30+
with:
31+
api_key: ${{ secrets.NEXUSMODS_API_KEY }}
32+
file_id: ${{ secrets.NEXUSMODS_FILE_ID }}
33+
filename: BigBankBoxPatternHelper.zip
34+
version: ${{ env.version }}
35+
update_mod_version: true

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,33 @@ jobs:
162162
git add update_meta.json
163163
git commit -m "chore: update release metadata for $TAG"
164164
git push origin HEAD:main
165+
166+
nexus:
167+
name: Upload to Nexus Mods
168+
needs: package
169+
permissions:
170+
contents: read
171+
environment: nexusmods
172+
runs-on: ubuntu-latest
173+
174+
steps:
175+
- name: Download GitHub release
176+
env:
177+
GH_REPO: ${{ github.repository }}
178+
GH_TOKEN: ${{ github.token }}
179+
TAG: ${{ github.ref_name }}
180+
shell: bash
181+
run: |
182+
set -euo pipefail
183+
184+
gh release download "$TAG" --pattern BigBankBoxPatternHelper.zip
185+
echo "version=${TAG#v}" >> "$GITHUB_ENV"
186+
187+
- name: Upload to Nexus Mods
188+
uses: Nexus-Mods/upload-action@c96019556046053aa26044b44396cd38929daf23 # v1.0.0-beta.10
189+
with:
190+
api_key: ${{ secrets.NEXUSMODS_API_KEY }}
191+
file_id: ${{ secrets.NEXUSMODS_FILE_ID }}
192+
filename: BigBankBoxPatternHelper.zip
193+
version: ${{ env.version }}
194+
update_mod_version: true

0 commit comments

Comments
 (0)