Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- removed unused post step
- docs and cleanup
  • Loading branch information
StephenHodgson authored Aug 12, 2024
1 parent f1a3cb2 commit 70b2331
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 29 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.cache/
node_modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# upload-steam

A GitHub action for uploading an [app build](https://partner.steamgames.com/doc/sdk/uploading#4) or [workshop item](https://partner.steamgames.com/doc/features/workshop/implementation#SteamCmd) to Steam.
A GitHub Action for uploading an [app build](https://partner.steamgames.com/doc/sdk/uploading#4) or [workshop item](https://partner.steamgames.com/doc/features/workshop/implementation#SteamCmd) to Steam.

## How to use

Expand Down
8 changes: 4 additions & 4 deletions action.yaml → action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: 'Upload to Steam'
description: 'A GitHub action for uploading an app build or workshop item to Steam.'

description: 'A GitHub Action for uploading an app build or workshop item to Steam.'
branding:
icon: 'upload-cloud'
color: 'blue'
inputs:
username:
description: 'A steamworks build account username.'
Expand Down Expand Up @@ -53,11 +55,9 @@ inputs:
workshop_item:
description: 'Optional, The path to a predefined workshop_item.vdf file. Overrides all other set options.'
required: false

outputs:
manifest:
description: 'Path to the generated manifest.vdf file.'
runs:
using: 'node20'
main: 'dist/index.js'
post: 'dist/index.js'
15 changes: 6 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26335,6 +26335,7 @@ const fs = __nccwpck_require__(3292);
const path = __nccwpck_require__(1017);
const steamTotp = __nccwpck_require__(3627);
const steamcmd = __nccwpck_require__(404);

const STEAM_DIR = process.env.STEAM_DIR;
const STEAM_CMD = process.env.STEAM_CMD;

Expand Down Expand Up @@ -28528,12 +28529,11 @@ var __webpack_exports__ = {};
const core = __nccwpck_require__(2186);
const upload = __nccwpck_require__(9265);
const auth = __nccwpck_require__(4915);

const STEAM_DIR = process.env.STEAM_DIR;
const STEAM_CMD = process.env.STEAM_CMD;
const STEAM_TEMP = process.env.STEAM_TEMP;

const IS_POST = !!core.getState('isPost');

const main = async () => {
try {
if (!STEAM_DIR) {
Expand All @@ -28545,14 +28545,11 @@ const main = async () => {
if (!STEAM_TEMP) {
throw new Error('STEAM_TEMP is not defined.');
}
if (!IS_POST) {
core.saveState('isPost', 'true');
const isLoggedIn = await auth.IsLoggedIn();
if (!isLoggedIn) {
await auth.Login();
}
await upload.Run();
const isLoggedIn = await auth.IsLoggedIn();
if (!isLoggedIn) {
await auth.Login();
}
await upload.Run();
} catch (error) {
core.setFailed(error);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "upload-steam",
"version": "1.0.0",
"description": "A GitHub action for uploading an app build or workshop item to Steam.",
"version": "1.0.1",
"description": "A GitHub Action for uploading an app build or workshop item to Steam.",
"author": "RageAgainstThePixel",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs/promises');
const path = require('path');
const steamTotp = require('steam-totp');
const steamcmd = require('./steamcmd');

const STEAM_DIR = process.env.STEAM_DIR;
const STEAM_CMD = process.env.STEAM_CMD;

Expand Down
14 changes: 5 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const core = require('@actions/core');
const upload = require('./upload');
const auth = require('./auth');

const STEAM_DIR = process.env.STEAM_DIR;
const STEAM_CMD = process.env.STEAM_CMD;
const STEAM_TEMP = process.env.STEAM_TEMP;

const IS_POST = !!core.getState('isPost');

const main = async () => {
try {
if (!STEAM_DIR) {
Expand All @@ -18,14 +17,11 @@ const main = async () => {
if (!STEAM_TEMP) {
throw new Error('STEAM_TEMP is not defined.');
}
if (!IS_POST) {
core.saveState('isPost', 'true');
const isLoggedIn = await auth.IsLoggedIn();
if (!isLoggedIn) {
await auth.Login();
}
await upload.Run();
const isLoggedIn = await auth.IsLoggedIn();
if (!isLoggedIn) {
await auth.Login();
}
await upload.Run();
} catch (error) {
core.setFailed(error);
}
Expand Down

0 comments on commit 70b2331

Please sign in to comment.