Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/automatic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: 🚀 Automatic Release

on:
pull_request:
branches:
- main
types: [closed]

env:
SUPPORTED_SERVER_VERSIONS: "1.4-b8 1.3-b9" # space-delimited
SUBFOLDER: ${{ github.event.repository.name }}
PROJECT_FOLDER: src

jobs:
release:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: 🚚 Checkout repository
uses: actions/checkout@v4

- name: 🔍 Inspect contents
run: |
version=$(sed -n '/Version/{s/.*<Version value=\"\(.*\)\"[ ]*\/>.*/\1/;p}' ModInfo.xml)
if gh release view "$version" > /dev/null 2>&1; then
echo "Release $version already exists; please update ModInfo.xml and create another pull request"
exit 1
fi
echo "version=$version" >> $GITHUB_ENV

prerelease=$([[ $version = 0* ]] && echo "true" || echo "false")
echo "prerelease=$prerelease" >> $GITHUB_ENV

- name: 🚛 Checkout 7dtd-references
uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/7dtd-references"
token: "${{ secrets.REFERENCES_TOKEN }}"
path: "7dtd-references"

- name: 🧐 Install mono
run: |
sudo apt-get update
sudo apt-get install -y mono-complete

- name: 🛻 Restore NuGet packages
run: |
nuget restore ${{ github.event.repository.name }}.sln

- name: 📦 Build and package artifacts
run: |
for GAME_VERSION in ${{ env.SUPPORTED_SERVER_VERSIONS }}; do
echo "building and packing mod for 7DTD version $GAME_VERSION"

# update reference paths
sed -i "s|<HintPath>..\\\\..\\\\..\\\\..\\\\..\\\\..\\\\Program Files (x86)\\\\Steam\\\\steamapps\\\\common\\\\7 Days to Die Dedicated Server|<HintPath>..\\\\7dtd-references\\\\${GAME_VERSION}|g" ${{ env.PROJECT_FOLDER }}/*.csproj

# update build release version
sed -i "s|DLL_VERSION = \"test-version\"|DLL_VERSION = \"${{ env.version }}\"|g" ${{ env.PROJECT_FOLDER }}/ModApi.cs

# update build target version
sed -i "s|BUILD_TARGET = \"test-target\"|BUILD_TARGET = \"$GAME_VERSION\"|g" ${{ env.PROJECT_FOLDER }}/ModApi.cs


# uncomment if troubleshooting becomes necessary
# echo "${{ env.PROJECT_FOLDER }}/*.csproj references were modified to the following:"
# cat "${{ env.PROJECT_FOLDER }}/*.csproj"

msbuild ${{ github.event.repository.name }}.sln /p:Configuration=Release
if [ $? -ne 0 ]; then
echo "build for $GAME_VERSION failed and will be skipped"
continue
else
echo "build for $GAME_VERSION was successful"
fi

mkdir "${{ env.SUBFOLDER }}"
cp -r Config "${{ env.SUBFOLDER }}/"
cp ModInfo.xml "${{ env.SUBFOLDER }}/"
cp README.md "${{ env.SUBFOLDER }}/"
cp CHANGELOG.md "${{ env.SUBFOLDER }}/"
cp "*.dll" "${{ env.SUBFOLDER }}/"
zip -r "${{ github.event.repository.name }}-${{ env.version }}-7dtd-$GAME_VERSION.zip" "${{ env.SUBFOLDER }}"
rm -rf "${{ env.SUBFOLDER }}"
done
if ! ls *.zip > /dev/null 2>&1; then
echo "could not successfully build for any of the supported versions of 7 days to die"
exit 1
fi

- name: 📰 Post new release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.version }}
commit: main
name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
generateReleaseNotes: true
artifacts: "*.zip"
prerelease: ${{ env.prerelease }}
# if you'd like to review the generated release before publishing it, enable draft mode
# draft: true
106 changes: 106 additions & 0 deletions .github/workflows/pack-and-attach-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: 📦 Pack and Attach Artifact

on:
workflow_dispatch:
inputs:
release_tag:
description: 'Tag of the existing release'
required: true
type: string
server_version:
description: '7DTD Server Version'
required: true
default: '1.4-b8'
type: choice
options:
- '1.4-b8'
- '1.3-b9'

permissions:
contents: write


# NOTE: in `run` steps, all 3 of these options are valid ways to reference these env vars:
# ${{ env.VERSION }}
# ${VERSION}
# $VERSION
env:
PROJECT_FOLDER: Source
VERSION: ${{ github.event.inputs.release_tag }}
GAME_VERSION: "${{ github.event.inputs.server_version }}"
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.inputs.release_tag }}-7dtd-${{ github.event.inputs.server_version }}.zip
SUBFOLDER: ${{ github.event.repository.name }}

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: 🚚 Checkout repository
uses: actions/checkout@v4
with:
ref: "${{ env.VERSION }}"

- name: 🔍 Verify release exists
run: |
gh release view "${{ env.VERSION }}" || { echo "Release named '${{ env.VERSION }}' not found; please target a tag with an existing Release."; exit 1; }
env:
GH_TOKEN: ${{ github.token }}

- name: 🚛 Checkout 7dtd-references
uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/7dtd-references"
token: "${{ secrets.REFERENCES_TOKEN }}"
path: "7dtd-references"

- name: 📝 Update ModInfo.xml version and project references
run: |
# update ModInfo version to match tag (in case updating it in source was forgotten)
sed -i "s|<Version value=\"[^\"]*\" />|<Version value=\"{${{ env.VERSION }}}\" />|" ModInfo.xml

# update reference paths
sed -i "s|<HintPath>..\\\\..\\\\..\\\\..\\\\..\\\\..\\\\Program Files (x86)\\\\Steam\\\\steamapps\\\\common\\\\7 Days to Die Dedicated Server|<HintPath>..\\\\7dtd-references\\\\${GAME_VERSION}|g" ${{ env.PROJECT_FOLDER }}/*.csproj

# update build release version
sed -i "s|DLL_VERSION = \"test-version\"|DLL_VERSION = \"${{ env.version }}\"|g" ${{ env.PROJECT_FOLDER }}/ModApi.cs

# update build target version
sed -i "s|BUILD_TARGET = \"test-target\"|BUILD_TARGET = \"$GAME_VERSION\"|g" ${{ env.PROJECT_FOLDER }}/ModApi.cs


echo "project file references were modified to the following:"
cat "${{ env.PROJECT_FOLDER }}/*.csproj"

- name: 🧐 Install mono
run: |
sudo apt-get update
sudo apt-get install -y mono-complete

- name: 🛻 Restore NuGet packages
run: |
nuget restore ${{ github.event.repository.name }}.sln

- name: 📦 Build and package artifact
run: |
msbuild ${{ github.event.repository.name }}.sln /p:Configuration=Release
mkdir "${{ env.SUBFOLDER }}"
cp -r Config "${{ env.SUBFOLDER }}/"
cp ModInfo.xml "${{ env.SUBFOLDER }}/"
cp README.md "${{ env.SUBFOLDER }}/"
cp CHANGELOG.md "${{ env.SUBFOLDER }}/"
cp "*.dll" "${{ env.SUBFOLDER }}/"
zip -r "${{ env.ARCHIVE_NAME }}.zip" "${{ env.SUBFOLDER }}"
ls -alr

- name: ⬆️ Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}.zip

- name: 📋 Attach artifact
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION }}
files: ${{ env.ARCHIVE_NAME }}.zip
44 changes: 0 additions & 44 deletions .github/workflows/release.yml

This file was deleted.

76 changes: 70 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.dll

# Created by https://www.toptal.com/developers/gitignore/api/visualstudio,visualstudiocode,csharp,git
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,visualstudiocode,csharp,git
# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,visualstudio,visualstudiocode,git,csharp
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,visualstudio,visualstudiocode,git,csharp

### Csharp ###
## Ignore Visual Studio temporary files, build results, and
Expand Down Expand Up @@ -415,6 +416,53 @@ FodyWeavers.xsd
*_LOCAL_*.txt
*_REMOTE_*.txt

### Linux ###

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
!.vscode/*.code-snippets

Expand All @@ -428,10 +476,26 @@ FodyWeavers.xsd
.history
.ionide

# Support for Project snippet scope
.vscode/*.code-snippets
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files

# Ignore code-workspaces
# Windows shortcuts
*.lnk

### VisualStudio ###

Expand Down Expand Up @@ -614,4 +678,4 @@ FodyWeavers.xsd
### VisualStudio Patch ###
# Additional files built by Visual Studio

# End of https://www.toptal.com/developers/gitignore/api/visualstudio,visualstudiocode,csharp,git
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,visualstudio,visualstudiocode,git,csharp
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.0.1] - 2025-04-11

- rebuilt mod for 7dtd 1.4 (b8)
- update pipeline to build multiple versions

## [5.0.0] - 2025-02-15

- update references for 7dtd-1.3-b9
Expand Down
2 changes: 1 addition & 1 deletion ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<DisplayName value="Quantum Elevators" />
<!-- REMINDER: this mod's DLL version will be logged on GameAwake and should reflect the same version listed here! -->
<!-- If troubleshooting an issue, search "Quantum Elevators DLL" in logs to confirm these two values match. -->
<Version value="5.0.0" />
<Version value="5.0.1" />
<Description value="Add infinite distance, vertical-warp elevator panels." />
<Author value="Jonathan Robertson (Kanaverum)" />
<Website value="https://github.com/jonathan-robertson/quantum-elevators" />
Expand Down
Binary file removed QuantumElevators.dll
Binary file not shown.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Quantum Elevators

[![🧪 Tested with 7DTD 1.3 (b9)](https://img.shields.io/badge/🧪%20Tested%20with-7DTD%201.3%20(b9)-blue.svg)](https://7daystodie.com/)
[![🚀 Automatic Release](https://github.com/jonathan-robertson/quantum-elevators/actions/workflows/automatic-release.yml/badge.svg)](https://github.com/jonathan-robertson/quantum-elevators/actions/workflows/automatic-release.yml)
[![✅ Dedicated Servers Supported ServerSide](https://img.shields.io/badge/✅%20Dedicated%20Servers-Supported%20Serverside-blue.svg)](https://7daystodie.com/)
[![✅ Single Player and P2P Supported](https://img.shields.io/badge/✅%20Single%20Player%20and%20P2P-Supported-blue.svg)](https://7daystodie.com/)
[![📦 Automated Release](https://github.com/jonathan-robertson/quantum-elevators/actions/workflows/release.yml/badge.svg)](https://github.com/jonathan-robertson/quantum-elevators/actions/workflows/release.yml)

![quantum-elevators social image](https://raw.githubusercontent.com/jonathan-robertson/quantum-elevators/media/quantum-elevators-logo-social.jpg)

Expand Down
Loading
Loading