You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.0 KiB
YAML

name: Release Module on Steam
on:
workflow_call:
inputs:
mod_description:
required: false
type: string
default: ''
artifact_name:
required: true
type: string
secrets:
STEAM_LOGIN:
required: true
STEAM_AUTH_CODE:
required: true
STEAM_PASSWORD:
required: true
jobs:
publish-on-steam:
name: Publish Module on Steam
runs-on: ubuntu-latest
steps:
- name: Setup
uses: butr/actions-common-setup@v2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download Module artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: ./artifact
- run: |
mkdir steam-totp
mkdir steam-totp/src
cat << EOT > steam-totp/package.json
{
"name": "steam-totp-gen",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"steam-totp": "^2.1.2"
}
}
- run: |
cat << EOT > steam-totp/package-lock.json
{
"name": "steam-totp-gen",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "steam-totp-gen",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"steam-totp": "^2.1.2"
}
},
"node_modules/steam-totp": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/steam-totp/-/steam-totp-2.1.2.tgz",
"integrity": "sha512-bTKlc/NoIUQId+my+O556s55DDsNNXfVIPWFDNVu68beql7AJhV0c+GTjFxfwCDYfdc4NkAme+0WrDdnY2D2VA==",
"engines": {
"node": ">=6.0.0"
}
}
},
"dependencies": {
"steam-totp": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/steam-totp/-/steam-totp-2.1.2.tgz",
"integrity": "sha512-bTKlc/NoIUQId+my+O556s55DDsNNXfVIPWFDNVu68beql7AJhV0c+GTjFxfwCDYfdc4NkAme+0WrDdnY2D2VA=="
}
}
}
- run: |
cat << EOT > steam-totp/src/index.js
console.log(require('steam-totp').generateAuthCode(process.argv[2]));
- uses: actions/setup-node@v3.4.1
with:
node-version: 16
- run: cd ./steam-totp && npm ci
- uses: CyberAndrii/setup-steamcmd@v1
- run: |
cat << EOT > item.vdf
"workshopitem"
{
"appid" "261550"
"publishedfileid" "2859188632"
"contentfolder" "./artifact"
"changenote" "${{ inputs.mod_description }}"
}
EOT
- run: |
code=$(node steam-totp/src/index.js ${{ secrets.STEAM_AUTH_CODE }})
echo "::add-mask::$code"
steamcmd +login "${{ secrets.STEAM_LOGIN }}" "${{ secrets.STEAM_PASSWORD }}" "$code" +workshop_build_item "./item.vdf" +quit