Skip to content

Commit

Permalink
Embed commit hash in Workshop uploads (#2859)
Browse files Browse the repository at this point in the history
* Embed commit hash in Workshop uploads

* Typo

* Embed directly into wirelib

* Add newline

* Fix Canary
  • Loading branch information
Denneisk authored Nov 16, 2023
1 parent c83ae32 commit f5a97e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:

steps:
- uses: actions/checkout@master

- name: Embed version
run: |
echo -e "\ncachedversion = \"Canary ${GITHUB_SHA:0:7}\"" >> lua/wire/server/wirelib.lua
- uses: wiremod/gmod-upload@master
with:
id: 3066780663
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ jobs:

steps:
- uses: actions/checkout@master

- name: Embed version
run: |
echo -e "\ncachedversion = \"Workshop ${GITHUB_SHA:0:7}\"" >> lua/wire/server/wirelib.lua
- uses: wiremod/gmod-upload@master
with:
id: 160250458
changelog: "Deployment via Github to latest changes"
changelog: "Deployment via Github to commit ${GITHUB_SHA:0:7}"
env:
STEAM_USERNAME: ${{ secrets.WIRETEAM_WORKSHOP_USERNAME }}
STEAM_PASSWORD: ${{ secrets.WIRETEAM_WORKSHOP_PASSWORD }}
8 changes: 0 additions & 8 deletions lua/wire/server/wirelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1223,14 +1223,6 @@ function WireLib.GetVersion()
end
end

-- Check if we're Workshop version first
for k, addon in pairs(engine.GetAddons()) do
if addon.wsid == "160250458" then
cachedversion = "Workshop"
return cachedversion
end
end

if not cachedversion then cachedversion = "Unknown" end

return cachedversion
Expand Down

0 comments on commit f5a97e1

Please sign in to comment.