Skip to content

Revert "Add attestation" #12

Revert "Add attestation"

Revert "Add attestation" #12

Workflow file for this run

name: CI
permissions:
actions: write
contents: write
on:
push:
jobs:
build:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Prepare
- name: Prepare on Windows
if: matrix.os == 'windows-latest'
env:
STEAM_TOKEN_DUMPER_TOKEN: ${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
shell: pwsh
run: |
Set-StrictMode -Version Latest
(Get-Content "ApiClient.cs").Replace('@STEAMDB_BUILD_TOKEN@', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "ApiClient.cs"
- name: Prepare on Linux
if: matrix.os == 'ubuntu-latest'
env:
STEAM_TOKEN_DUMPER_TOKEN: ${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
shell: sh
run: |
set -eu
sed --in-place "s/@STEAMDB_BUILD_TOKEN@/${STEAM_TOKEN_DUMPER_TOKEN}/" "ApiClient.cs"
# Publish
- name: Publish for Windows
if: matrix.os == 'windows-latest'
run: dotnet publish --configuration Release --runtime win-x64 --self-contained --output bin/SteamTokenDumper /p:PublishSingleFile=true /p:PublishTrimmed=true SteamTokenDumper.csproj
- name: Publish for Linux
if: matrix.os == 'ubuntu-latest'
run: dotnet publish --configuration Release --runtime linux-x64 --self-contained true --output bin/SteamTokenDumper /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeNativeLibrariesForSelfExtract=true SteamTokenDumper.csproj
# Archive
- name: Prepare archive on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Set-StrictMode -Version Latest
Get-Content LICENSE, release_license.txt | Set-Content bin\SteamTokenDumper\LICENSE.txt
- name: Prepare archive on Linux
if: matrix.os == 'ubuntu-latest'
shell: sh
run: |
set -eu
cat LICENSE release_license.txt > bin/SteamTokenDumper/LICENSE.txt
# Upload
- name: Upload Windows
uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: SteamTokenDumper-windows-x64
path: bin/SteamTokenDumper
- name: Upload Linux
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: SteamTokenDumper-linux-x64
path: bin/SteamTokenDumper
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display artifacts folder structure
run: ls -Rl
working-directory: artifacts
- name: Create release files
run: |
set -eux
mkdir release
# Linux
cd artifacts/SteamTokenDumper-linux-x64/
chmod +x SteamTokenDumper
tar --use-compress-program 'gzip -9' --create --verbose --owner=0 --group=0 --file ../../release/SteamTokenDumper-linux.tar.gz -- *
cd ../../
# Windows
zip -9 --junk-paths release/SteamTokenDumper-windows.zip artifacts/SteamTokenDumper-windows-x64/*
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}