3 on: [push, pull_request]
7 DOTNET_CLI_TELEMETRY_OPTOUT: true
9 DOTNET_SDK_VERSION: 8.0
10 NODE_JS_VERSION: 'lts/*'
11 PLUGINS_BUNDLED: ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
12 PLUGINS_INCLUDED: ArchiSteamFarm.OfficialPlugins.Monitoring # Apart from declaring them here, there is certain amount of hardcoding needed below for uploading
18 runs-on: ubuntu-latest
22 uses: actions/checkout@v4.1.1
27 - name: Setup Node.js with npm
28 uses: actions/setup-node@v4.0.2
31 node-version: ${{ env.NODE_JS_VERSION }}
33 - name: Verify Node.js
39 - name: Install npm modules for ASF-ui
40 run: npm ci --no-progress --prefix ASF-ui
42 - name: Publish ASF-ui
43 run: npm run-script deploy --no-progress --prefix ASF-ui
46 uses: actions/upload-artifact@v4.3.1
48 if-no-files-found: error
76 runs-on: ${{ matrix.os }}
80 uses: actions/checkout@v4.1.1
84 - name: Setup .NET Core
85 uses: actions/setup-dotnet@v4.0.0
87 dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
89 - name: Verify .NET Core
92 - name: Download previously built ASF-ui
93 uses: actions/download-artifact@v4.1.4
98 - name: Prepare private key for signing on Unix
99 if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
101 ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }}
106 if [ -n "${ASF_PRIVATE_SNK-}" ]; then
107 echo "$ASF_PRIVATE_SNK" | base64 -d > "resources/ArchiSteamFarm.snk"
110 - name: Prepare private key for signing on Windows
111 if: startsWith(matrix.os, 'windows-')
113 ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }}
116 Set-StrictMode -Version Latest
117 $ErrorActionPreference = 'Stop'
118 $ProgressPreference = 'SilentlyContinue'
120 if ((Test-Path env:ASF_PRIVATE_SNK) -and ($env:ASF_PRIVATE_SNK)) {
121 echo "$env:ASF_PRIVATE_SNK" > "resources\ArchiSteamFarm.snk"
123 certutil -f -decode "resources\ArchiSteamFarm.snk" "resources\ArchiSteamFarm.snk"
125 if ($LastExitCode -ne 0) {
126 throw "Last command failed."
130 - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Unix
131 if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
133 STEAM_TOKEN_DUMPER_TOKEN: ${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
138 if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then
139 sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" > "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new"
140 mv "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs.new" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"
143 - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Windows
144 if: startsWith(matrix.os, 'windows-')
146 STEAM_TOKEN_DUMPER_TOKEN: ${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
149 Set-StrictMode -Version Latest
150 $ErrorActionPreference = 'Stop'
151 $ProgressPreference = 'SilentlyContinue'
153 if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and ($env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs" -PathType Leaf)) {
154 (Get-Content "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs").Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs"
157 - name: Publish ASF-${{ matrix.variant }} on Unix
158 if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
160 VARIANT: ${{ matrix.variant }}
165 if [ "$VARIANT" = 'generic' ]; then
166 variantArgs="-p:TargetLatestRuntimePatch=false -p:UseAppHost=false"
168 variantArgs="-p:PublishSingleFile=true -p:PublishTrimmed=true -r $VARIANT --self-contained"
171 dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out/${VARIANT}" "-p:ASFVariant=${VARIANT}" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
173 # Include .ico file for all platforms, since only Windows script can bundle it inside the exe
174 cp "resources/ASF.ico" "out/${VARIANT}/ArchiSteamFarm.ico"
176 - name: Publish ASF-${{ matrix.variant }} on Windows
177 if: startsWith(matrix.os, 'windows-')
179 VARIANT: ${{ matrix.variant }}
182 Set-StrictMode -Version Latest
183 $ErrorActionPreference = 'Stop'
184 $ProgressPreference = 'SilentlyContinue'
186 if ($env:VARIANT -like 'generic*') {
187 $variantArgs = '-p:TargetLatestRuntimePatch=false', '-p:UseAppHost=false'
189 $variantArgs = '-p:PublishSingleFile=true', '-p:PublishTrimmed=true', '-r', "$env:VARIANT", '--self-contained'
192 dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -o "out\$env:VARIANT" "-p:ASFVariant=$env:VARIANT" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
194 if ($LastExitCode -ne 0) {
195 throw "Last command failed."
198 # Icon is available only in .exe Windows builds, we'll bundle the .ico file for other flavours
199 if (!(Test-Path "out\$env:VARIANT\ArchiSteamFarm.exe" -PathType Leaf)) {
200 Copy-Item 'resources\ASF.ico' "out\$env:VARIANT\ArchiSteamFarm.ico"
203 - name: Publish bundled plugins on Unix
204 if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
206 VARIANT: ${{ matrix.variant }}
211 if [ "$VARIANT" = 'generic' ]; then
212 variantArgs="-p:TargetLatestRuntimePatch=false -p:UseAppHost=false"
214 variantArgs="-r $VARIANT"
217 for plugin in $PLUGINS_BUNDLED; do
218 dotnet publish "$plugin" -c "$CONFIGURATION" -o "out/${VARIANT}/plugins/${plugin}" "-p:ASFVariant=${VARIANT}" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
221 - name: Publish bundled plugins on Windows
222 if: startsWith(matrix.os, 'windows-')
224 VARIANT: ${{ matrix.variant }}
227 Set-StrictMode -Version Latest
228 $ErrorActionPreference = 'Stop'
229 $ProgressPreference = 'SilentlyContinue'
231 if ($env:VARIANT -like 'generic*') {
232 $variantArgs = '-p:TargetLatestRuntimePatch=false', '-p:UseAppHost=false'
234 $variantArgs = '-r', "$env:VARIANT"
237 foreach ($plugin in $env:PLUGINS_BUNDLED.Split([char[]] $null, [System.StringSplitOptions]::RemoveEmptyEntries)) {
238 dotnet publish "$plugin" -c "$env:CONFIGURATION" -o "out\$env:VARIANT\plugins\$plugin" "-p:ASFVariant=$env:VARIANT" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
240 if ($LastExitCode -ne 0) {
241 throw "Last command failed."
245 - name: Zip ASF-${{ matrix.variant }} on Unix
246 if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
248 VARIANT: ${{ matrix.variant }}
253 # By default use fastest compression
254 seven_zip_args="-mx=1"
257 # Include extra logic for builds marked for release
258 case "$GITHUB_REF" in
260 # Tweak compression args for release publishing
261 seven_zip_args="-mx=9 -mfb=258 -mpass=15"
264 # Update link in Changelog.html accordingly
265 if [ -f "out/${VARIANT}/Changelog.html" ]; then
266 tag="$(echo "$GITHUB_REF" | cut -c 11-)"
268 sed "s/ArchiSteamFarm\/commits\/main/ArchiSteamFarm\/releases\/tag\/${tag}/g" "out/${VARIANT}/Changelog.html" > "out/${VARIANT}/Changelog.html.new"
269 mv "out/${VARIANT}/Changelog.html.new" "out/${VARIANT}/Changelog.html"
274 # Create the final zip file
275 case "$(uname -s)" in
277 # We prefer to use zip on macOS as 7z implementation on that OS doesn't handle file permissions (chmod +x)
278 if command -v zip >/dev/null; then
280 cd "${GITHUB_WORKSPACE}/out/${VARIANT}"
281 zip -q -r $zip_args "../ASF-${VARIANT}.zip" .
284 7z a -bd -slp -tzip -mm=Deflate $seven_zip_args "out/ASF-${VARIANT}.zip" "${GITHUB_WORKSPACE}/out/${VARIANT}/*"
288 if command -v 7z >/dev/null; then
289 7z a -bd -slp -tzip -mm=Deflate $seven_zip_args "out/ASF-${VARIANT}.zip" "${GITHUB_WORKSPACE}/out/${VARIANT}/*"
292 cd "${GITHUB_WORKSPACE}/out/${VARIANT}"
293 zip -q -r $zip_args "../ASF-${VARIANT}.zip" .
299 - name: Zip ASF-${{ matrix.variant }} on Windows
300 if: startsWith(matrix.os, 'windows-')
302 VARIANT: ${{ matrix.variant }}
305 Set-StrictMode -Version Latest
306 $ErrorActionPreference = 'Stop'
307 $ProgressPreference = 'SilentlyContinue'
309 # By default use fastest compression
310 $compressionArgs = '-mx=1'
312 # Include extra logic for builds marked for release
313 if ($env:GITHUB_REF -like 'refs/tags/*') {
314 # Tweak compression args for release publishing
315 $compressionArgs = '-mx=9', '-mfb=258', '-mpass=15'
317 # Update link in Changelog.html accordingly
318 if (Test-Path "out\$env:VARIANT\Changelog.html" -PathType Leaf) {
319 $tag = $env:GITHUB_REF.Substring(10)
321 (Get-Content "out\$env:VARIANT\Changelog.html").Replace('ArchiSteamFarm/commits/main', "ArchiSteamFarm/releases/tag/$tag") | Set-Content "out\$env:VARIANT\Changelog.html"
325 # Create the final zip file
326 7z a -bd -slp -tzip -mm=Deflate $compressionArgs "out\ASF-$env:VARIANT.zip" "$env:GITHUB_WORKSPACE\out\$env:VARIANT\*"
328 if ($LastExitCode -ne 0) {
329 throw "Last command failed."
332 # We can aid non-windows users by adding chmod +x flag to appropriate executables directly in the zip file
333 # This is ALMOST a hack, but works reliably enough
334 if (Test-Path "tools\zip_exec\zip_exec.exe" -PathType Leaf) {
335 $executableFiles = @()
337 if ($env:VARIANT -like 'generic*') {
338 $executableFiles += 'ArchiSteamFarm.sh', 'ArchiSteamFarm-Service.sh'
339 } elseif (($env:VARIANT -like 'linux*') -or ($env:VARIANT -like 'osx*')) {
340 $executableFiles += 'ArchiSteamFarm', 'ArchiSteamFarm-Service.sh'
343 foreach ($executableFile in $executableFiles) {
344 tools\zip_exec\zip_exec.exe "out\ASF-$env:VARIANT.zip" "$executableFile"
346 if ($LastExitCode -ne 0) {
347 throw "Last command failed."
352 - name: Upload ASF-${{ matrix.variant }}
353 uses: actions/upload-artifact@v4.3.1
355 if-no-files-found: error
356 name: ${{ matrix.os }}_ASF-${{ matrix.variant }}
357 path: out/ASF-${{ matrix.variant }}.zip
359 - name: Publish included plugins on Unix
360 if: ${{ matrix.os == 'ubuntu-latest' && matrix.variant == 'generic' }}
362 VARIANT: ${{ matrix.variant }}
368 dotnet publish "$1" -c "$CONFIGURATION" -o "out/${1}" "-p:ASFVariant=${VARIANT}" -p:ContinuousIntegrationBuild=true -p:TargetLatestRuntimePatch=false -p:UseAppHost=false --nologo
370 # By default use fastest compression
371 seven_zip_args="-mx=1"
374 # Include extra logic for builds marked for release
375 case "$GITHUB_REF" in
377 # Tweak compression args for release publishing
378 seven_zip_args="-mx=9 -mfb=258 -mpass=15"
383 # Create the final zip file
384 if command -v 7z >/dev/null; then
385 7z a -bd -slp -tzip -mm=Deflate $seven_zip_args "out/${1}.zip" "${GITHUB_WORKSPACE}/out/${1}/*"
388 cd "${GITHUB_WORKSPACE}/out/${1}"
389 zip -q -r $zip_args "../${1}.zip" .
394 for plugin in $PLUGINS_INCLUDED; do
398 - name: Upload ArchiSteamFarm.OfficialPlugins.Monitoring
399 if: ${{ matrix.os == 'ubuntu-latest' && matrix.variant == 'generic' }}
400 uses: actions/upload-artifact@v4.3.1
402 if-no-files-found: error
403 name: ArchiSteamFarm.OfficialPlugins.Monitoring
404 path: out/ArchiSteamFarm.OfficialPlugins.Monitoring.zip
407 if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
409 runs-on: ubuntu-latest
415 - name: Checkout code
416 uses: actions/checkout@v4.1.1
420 - name: Download ASF-generic artifact from ubuntu-latest
421 uses: actions/download-artifact@v4.1.4
423 name: ubuntu-latest_ASF-generic
426 - name: Download ASF-linux-arm artifact from ubuntu-latest
427 uses: actions/download-artifact@v4.1.4
429 name: ubuntu-latest_ASF-linux-arm
432 - name: Download ASF-linux-arm64 artifact from ubuntu-latest
433 uses: actions/download-artifact@v4.1.4
435 name: ubuntu-latest_ASF-linux-arm64
438 - name: Download ASF-linux-x64 artifact from ubuntu-latest
439 uses: actions/download-artifact@v4.1.4
441 name: ubuntu-latest_ASF-linux-x64
444 - name: Download ASF-osx-arm64 artifact from macos-latest
445 uses: actions/download-artifact@v4.1.4
447 name: macos-latest_ASF-osx-arm64
450 - name: Download ASF-osx-x64 artifact from macos-latest
451 uses: actions/download-artifact@v4.1.4
453 name: macos-latest_ASF-osx-x64
456 - name: Download ASF-win-arm64 artifact from windows-latest
457 uses: actions/download-artifact@v4.1.4
459 name: windows-latest_ASF-win-arm64
462 - name: Download ASF-win-x64 artifact from windows-latest
463 uses: actions/download-artifact@v4.1.4
465 name: windows-latest_ASF-win-x64
468 - name: Download ArchiSteamFarm.OfficialPlugins.Monitoring artifact
469 uses: actions/download-artifact@v4.1.4
471 name: ArchiSteamFarm.OfficialPlugins.Monitoring
474 - name: Import GPG key for signing
475 uses: crazy-max/ghaction-import-gpg@v6.1.0
477 gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
479 - name: Generate SHA-512 checksums and signature
487 sha512sum *.zip > SHA512SUMS
488 gpg -a -b -o SHA512SUMS.sign SHA512SUMS
491 - name: Upload SHA512SUMS
492 uses: actions/upload-artifact@v4.3.1
494 if-no-files-found: error
498 - name: Upload SHA512SUMS.sign
499 uses: actions/upload-artifact@v4.3.1
501 if-no-files-found: error
502 name: SHA512SUMS.sign
503 path: out/SHA512SUMS.sign
505 - name: Create ArchiSteamFarm GitHub release
506 uses: ncipollo/release-action@v1.14.0
509 artifactErrorsFailBuild: true
511 bodyFile: .github/RELEASE_TEMPLATE.md
513 name: ArchiSteamFarm V${{ github.ref_name }}
515 token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
516 updateOnlyUnreleased: true