Skip to content

Commit

Permalink
Merge pull request #27 from stayintarkov/mihaicm93-patch-1
Browse files Browse the repository at this point in the history
Integration of SPT-AKI Server Build with SITCoop Mod in GitHub Actions Workflow
  • Loading branch information
paulov-t authored Feb 19, 2024
2 parents ea36ee5 + 235dcc5 commit 0ccd504
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/Create-Release-with-SPT-AKI-Integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
workflow_dispatch:

name: Create Release with SPT-AKI Integration on Windows

jobs:
build:
permissions: write-all
name: Create Release
runs-on: windows-latest
steps:
- name: Checkout SIT-Server-Mod Branch
uses: actions/checkout@v2
with:
ref: 'master'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.10.0'

- name: Install dependencies
run: npm ci

- name: Build SIT-Server-Mod
run: npm run build

- name: Read package.json
id: read_package_json
run: echo "::set-output name=version::$(node -e 'console.log(require(`./package.json`).version)')"

- name: Clone SPT-AKI Server
run: |
git clone -b 3.8.0 --single-branch https://dev.sp-tarkov.com/SPT-AKI/Server.git SPT-AKI-Server
cd SPT-AKI-Server
git lfs fetch
git lfs pull
- name: Build SPT-AKI Server
run: |
cd SPT-AKI-Server\project
npm install
npm run build:release
shell: pwsh

- name: Setup temporary directory for zipping
run: |
$tempPath = "tempZipContents"
New-Item -ItemType Directory -Force -Path $tempPath
New-Item -ItemType Directory -Force -Path "$tempPath\user\mods\SITCoop"
shell: pwsh

- name: Copy build contents to temporary directory
run: |
Copy-Item -Path "SPT-AKI-Server\project\build\*" -Destination "tempZipContents" -Recurse
shell: pwsh

- name: Copy SITCoop mod to temporary directory
run: |
Copy-Item -Path "SITCoop\*" -Destination "tempZipContents\user\mods\SITCoop" -Recurse
shell: pwsh

- name: Zip the temporary directory
run: |
Compress-Archive -Path "tempZipContents\*" -DestinationPath "SPT-AKI-with-SITCoop.zip" -Force
shell: pwsh

- name: Cleanup temporary directory
run: |
Remove-Item -Path "tempZipContents" -Recurse -Force
shell: pwsh

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.read_package_json.outputs.version }}
name: SPT-AKI-with-SITCoop-${{ github.run_number }}
files: SPT-AKI-with-SITCoop.zip
draft: true
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0ccd504

Please sign in to comment.