Skip to content

Release

Release #256

Workflow file for this run

name: Release
env:
TZ: Asia/Shanghai
on:
push:
paths-ignore:
- "README.md"
- "DEV.md"
- "CHANGELOG.md"
- ".gitignore"
- "steamDESC.txt"
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set the environment variable
shell: pwsh
run: |
$ref = $env:GITHUB_REF
if ($ref.StartsWith('refs/tags/')) {
$tag = $ref.Substring(10)
echo "Setting TAG_NAME=$tag"
echo "TAG_NAME=$tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} elseif ($ref.StartsWith('refs/heads/')) {
$branch = $ref.Substring(11)
echo "Setting TAG_NAME=$branch"
echo "TAG_NAME=$branch" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "Unknown ref type: $ref"
}
$commitId = $env:GITHUB_SHA
$shortCommitId = $commitId.Substring(0, 7)
echo "Setting COMMIT_ID=$shortCommitId"
echo "COMMIT_ID=$shortCommitId" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Run integration script
shell: cmd
run: |
call ./main.bat
- name: Upload generated files
uses: actions/upload-artifact@v4
with:
name: ETC
path: ETC-*.zip
nightly-release:
permissions: write-all
needs: build
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/') != true
steps:
- uses: actions/download-artifact@v4
with:
name: ETC
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly-release"
prerelease: true
title: "test Build"
files: |
ETC-*.zip
release:
permissions: write-all
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ETC
- name: Release Action
uses: softprops/action-gh-release@v2
with:
files: |
ETC-*.zip
body_path: CHANGELOG.md
discussion_category_name: "公告"
publish:
runs-on: windows-2019
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ETC
- name: Unzip mod
run: |
mkdir output
7z.exe x ETC-*.zip -ooutput
shell: cmd
- name: Get steamcmd
run: |
dir
curl https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip --output steamcmd.zip
7z.exe e steamcmd.zip -osteamcmd
dir
shell: cmd
- name: Checkout steamcmd config
uses: actions/checkout@v4
with:
repository: Cccc-owo/steamcmd
token: ${{ secrets.STEAMCMD_TOKEN }}
path: steamcmd/config
- name: Upload Steam workshop
run: |
cd steamcmd
dir
steamcmd.exe -dev -textmode -ignoredxsupportcfg +login %STEAM_LOGIN_NAME% +workshop_build_item ..\resources\main.vdf +quit
env:
STEAM_LOGIN_NAME: ${{ secrets.STEAM_LOGIN_NAME }}
STEAM_LOGIN_PASSWORD: ${{ secrets.STEAM_LOGIN_PASSWORD }}
shell: cmd
continue-on-error: true