Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Mar 15, 2024
2 parents 1b3ef82 + b6a0eb8 commit a84a801
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/workshop-upload.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 8 additions & 0 deletions lua/acf/core/version/version_sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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")

Expand Down

0 comments on commit a84a801

Please sign in to comment.