diff --git a/.github/workflows/workshop-upload.yml b/.github/workflows/workshop-upload.yml new file mode 100644 index 000000000..5a6302767 --- /dev/null +++ b/.github/workflows/workshop-upload.yml @@ -0,0 +1,36 @@ +name: Deploy to Workshop + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + deploy: + if: github.repository == 'ACF-Team/ACF-3' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create Commit Version File + shell: bash + run: | + mkdir -p ~/data_static/acf + echo "${{ github.sha }}" > ~/data_static/acf/acf-3-version.txt + + - name: Upload to Workshop + uses: CFC-Servers/gmod-upload@master + with: + id: 3182725803 + changelog: "${{ github.event.head_commit.message }}" + title: "[ACF-3] Armored Combat Framework" + type: "tool" + tag1: "build" + tag2: "fun" + tag3: "realism" + env: + STEAM_USERNAME: ${{ secrets.ACF_STEAM_ACCOUNT }} + STEAM_PASSWORD: ${{ secrets.ACF_STEAM_PASSWORD }} \ No newline at end of file diff --git a/lua/acf/core/version/version_sh.lua b/lua/acf/core/version/version_sh.lua index 3c8e33d68..76fa48e04 100644 --- a/lua/acf/core/version/version_sh.lua +++ b/lua/acf/core/version/version_sh.lua @@ -65,6 +65,7 @@ do -- Local repository version checking if not Data then return end local Path = Data.Path + local WorkshopPath = "data_static/acf/" .. string.lower(Name) .. "-version.txt" if not Path then Data.Code = "Not Installed" @@ -77,6 +78,13 @@ do -- Local repository version checking Data.Code = "Git-" .. Code Data.Date = LocalToUTC(Date) + elseif file.Exists(WorkshopPath, "GAME") then + local FileData = file.Read(WorkshopPath, "GAME"):Trim() + local Code = string.sub(FileData, 1, 7) + local Date = file.Time(WorkshopPath, "GAME") + + Data.Code = "Workshop-" .. Code + Data.Date = LocalToUTC(Date) elseif file.Exists(Path .. "/LICENSE", "GAME") then local Date = file.Time(Path .. "/LICENSE", "GAME")