-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from stayintarkov/mihaicm93-patch-1
Integration of SPT-AKI Server Build with SITCoop Mod in GitHub Actions Workflow
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
.github/workflows/Create-Release-with-SPT-AKI-Integration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |