Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci fixes and repo cleanup + small tweaks and first release #2

Merged
merged 29 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a47c137
Update docker_build.yml
sapphonie Jul 14, 2023
bf0ff03
Update docker_build.yml
sapphonie Jul 14, 2023
cdc0168
Update docker_build.yml
sapphonie Jul 14, 2023
7ebbe9a
attempt to lint
sapphonie Jul 14, 2023
3bf45dc
use tags
sapphonie Jul 14, 2023
d0061de
Update docker_build.yml
sapphonie Jul 14, 2023
b4e914e
reorganize repo
sapphonie Jul 14, 2023
27c991c
Merge branch 'main' of github.com:sapphonie/SM-neocurl-ext
sapphonie Jul 14, 2023
b20ab72
correct typo with build dir
sapphonie Jul 14, 2023
7cb6d51
hacky chmod/chown for docker builds
sapphonie Jul 14, 2023
3a284bd
more hacks for chmod
sapphonie Jul 14, 2023
255fcb0
try to hack docker to work again
sapphonie Jul 14, 2023
aa4c2a4
fix invalid syntax
sapphonie Jul 14, 2023
9f3af56
remove extension in repo, remove spaces, fixup gitignore
sapphonie Jul 14, 2023
9a7258d
twiddle around with making releases with commits
sapphonie Jul 14, 2023
b2fd13b
more ci testing to use non deprecated actions
sapphonie Jul 14, 2023
c67827c
Update docker_build.yml
sapphonie Jul 14, 2023
5cd7b0e
more ci twiddling (ugh)
sapphonie Jul 14, 2023
9ab3c5d
Merge branch 'main' of github.com:sapphonie/SM-neocurl-ext
sapphonie Jul 14, 2023
920a62c
more lint and run the actual job now
sapphonie Jul 14, 2023
84cd504
lint more and use deb slim
sapphonie Jul 14, 2023
1a36cb3
autogen rel notes (?)
sapphonie Jul 14, 2023
d7d9920
fixup bad quotes
sapphonie Jul 14, 2023
e2dd637
sigh. fix quotes again
sapphonie Jul 14, 2023
16db4f8
save beta autotagging for a later date
sapphonie Jul 14, 2023
88b26d9
gitignore
sapphonie Jul 14, 2023
827712e
fix so users don't use removed hash funcs
sapphonie Jul 14, 2023
d0fba0c
add max dbg info to ext
sapphonie Jul 14, 2023
515aa3c
update versionings
sapphonie Jul 14, 2023
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
93 changes: 37 additions & 56 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,38 @@
on:
push
'on':
push:
tags:
- v*
jobs:
compile:
name: Compile extension in docker
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
options: -v ${{ github.workspace }}:/mnt/curl
run: |
bash /mnt/curl/ci/_docker_script.sh

- name: Zip packages
run: |
pwd
ls -la
mkdir build
cd build
mkdir scripting/include -p
mkdir extensions
mkdir plugins
cp ../Release/curl.ext.so extensions/ -v
7za a -r build/sm-neocurl.zip scripting/ plugins/ extensions/
ls -la
pwd

- name: Set Commit Hash
id: commit_info
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/stac.zip
asset_name: stac.zip
asset_content_type: application/zip
compile:
name: Compile extension in docker
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: 'debian:11-slim'
options: '-v ${{ github.workspace }}:/mnt/curl'
run: |
bash /mnt/curl/ci/_docker_script.sh
- name: Zip packages
run: |
pwd
ls -la
pushd build
7za a -r sm-neocurl.zip scripting/ plugins/ extensions/
ls -la
pwd
ls -la
popd
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/sm-neocurl.zip
fail_on_unmatched_files: true
generate_release_notes: true
# if: contains(github.ref, 'beta')
# prerelease: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ mm-*
test*
Release/
Debug/
build
build/*
1 change: 0 additions & 1 deletion .hgignore

This file was deleted.

45 changes: 37 additions & 8 deletions ci/_docker_script.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
#!/bin/bash

cd /mnt/curl/
dpkg --add-architecture i386
apt update
apt install p7zip-full git ca-certificates build-essential g++-multilib -y --no-install-recommends
# lib32stdc++-10-dev lib32z1-dev libc6-dev-i386 linux-libc-dev:i386
cd /mnt/curl/ || exit
git config --global --add safe.directory "*"
rm -rf ./sm-1.11
git clone https://github.com/alliedmodders/sourcemod --branch 1.11-dev sm-1.11 --recursive
rm -rf ./mm-1.11
git clone https://github.com/alliedmodders/metamod-source --branch 1.11-dev mm-1.11 --recursive
make clean
make
rm -rf build
mkdir build
mkdir build/extensions -p
mkdir build/scripting -p
mkdir build/plugins -p

pushd build || exit
rm -rf ./sm-1.11
git clone https://github.com/alliedmodders/sourcemod --branch 1.11-dev sm-1.11 --recursive
rm -rf ./mm-1.11
git clone https://github.com/alliedmodders/metamod-source --branch 1.11-dev mm-1.11 --recursive
popd || exit

pushd extension || exit
make clean
make
mv Release/curl.ext.so ../build/extensions/ -v
rm -rf Release
popd || exit

cp pawn/* build/ -Rfv

# cleanup

pushd build || exit
rm -rf ./sm-1.11
rm -rf ./mm-1.11

7za a -r sm-neocurl.zip scripting/ plugins/ extensions/
popd || exit

chmod 777 ./* -Rfv
11 changes: 7 additions & 4 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
sdfasd#!/bin/bash
#!/bin/bash

# we do this so that we can be agnostic about where we're invoked from
# meaning you can exec this script anywhere and it should work the same
thisiswhereiam=${BASH_SOURCE[0]}
# this should be /whatever/directory/structure/Open-Fortress-Source
script_folder=$( cd -- "$( dirname -- "${thisiswhereiam}" )" &> /dev/null && pwd )

# this should be /whatever/directory/structure/[sdkmod-source]/build
build_dir="build"

img="registry.gitlab.steamos.cloud/steamrt/sniper/sdk"
img="debian:11-slim"
echo ${thisiswhereiam}
echo ${script_folder}
docker run -it \
--mount type=bind,source=${script_folder}/../,target=/mnt/curl \
registry.gitlab.steamos.cloud/steamrt/sniper/sdk \
bash
#/mnt/curl/ci/_docker_script.sh
--user "$(id -u):$(id -g)" \
${img} \
bash /mnt/curl/ci/_docker_script.sh



Expand Down
8 changes: 4 additions & 4 deletions Makefile → extension/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Makefile written by David "BAILOPAN" Anderson

#SMSDK = ../..
SMSDK = ./sm-1.11
SMSDK = ../build/sm-1.11
# SRCDS_BASE = ~/srcds
# MMSOURCE17 = ../../../mmsource-central
MMSOURCE17 = ./mm-1.11
MMSOURCE17 = ../build/mm-1.11

#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
Expand All @@ -29,8 +29,8 @@ OBJECTS = \
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################

C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing -g -ggdb
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions natives.cpp → extension/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,16 @@ static cell_t sm_curl_hash_file(IPluginContext *pContext, const cell_t *params)

static cell_t sm_curl_hash_string(IPluginContext *pContext, const cell_t *params)
{
Openssl_Hash hashType = (Openssl_Hash)params[3];
if
(
hashType == Openssl_Hash_MD2
|| hashType == Openssl_Hash_SHA
)
{
return pContext->ThrowNativeError("Deprecated hash function %x - Sorry!", params[3]);
}

char *input;
unsigned int data_size = (unsigned int)params[2];
if(data_size > 0)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 14 additions & 7 deletions opensslmanager.cpp → extension/opensslmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
#include <openssl/sha.h>
#include <openssl/ripemd.h>

// NEED to convert this to using EVP one of these days...
// https://www.openssl.org/docs/manmaster/man3/EVP_DigestInit.html
// -sappho

#define MD5_FILE_BUFFER_SIZE 1024*16
#define MD4_FILE_BUFFER_SIZE 1024*16
//#define MD2_FILE_BUFFER_SIZE 1024*16
// #define MD2_FILE_BUFFER_SIZE 1024*16
// #define SHA_FILE_BUFFER_SIZE 1024*16
#define SHA1_FILE_BUFFER_SIZE 1024*16
#define SHA224_FILE_BUFFER_SIZE 1024*16
Expand Down Expand Up @@ -283,12 +286,14 @@ bool OpensslManager::HashFile(Openssl_Hash algorithm, FILE *pFile, unsigned char
case Openssl_Hash_MD4:
MD4_File(pFile, output, outlength);
return true;
//case Openssl_Hash_MD2:
// MD2_File(pFile, output, outlength);
// return true;
//case Openssl_Hash_SHA:
// SHA_File(pFile, output, outlength);
// return true;
case Openssl_Hash_MD2:
//MD2_File(pFile, output, outlength);
//return true;
return false;
case Openssl_Hash_SHA:
//SHA_File(pFile, output, outlength);
//return true;
return false;
case Openssl_Hash_SHA1:
SHA1_File(pFile, output, outlength);
return true;
Expand Down Expand Up @@ -329,10 +334,12 @@ bool OpensslManager::HashString(Openssl_Hash algorithm, unsigned char *input, in
// MD2(input, size, output);
// *outlength = MD2_DIGEST_LENGTH;
// return true;
return false;
//case Openssl_Hash_SHA:
// SHA(input, size, output);
// *outlength = SHA_DIGEST_LENGTH;
// return true;
return false;
case Openssl_Hash_SHA1:
SHA1(input, size, output);
*outlength = SHA_DIGEST_LENGTH;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions sdk/smsdk_config.h → extension/sdk/smsdk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
*/

/* Basic information exposed publicly */
#define SMEXT_CONF_NAME "cURL Extension"
#define SMEXT_CONF_DESCRIPTION "cURL Extension"
#define SMEXT_CONF_VERSION "1.3.0.0"
#define SMEXT_CONF_AUTHOR "ben"
#define SMEXT_CONF_URL "http://www.ZombieX2.net/"
#define SMEXT_CONF_LOGTAG "cURL"
#define SMEXT_CONF_NAME "NEO cURL Extension"
#define SMEXT_CONF_DESCRIPTION "NEO cURL Extension"
#define SMEXT_CONF_VERSION "2.0.0.0"
#define SMEXT_CONF_AUTHOR "https://sappho.io - formerly ben"
#define SMEXT_CONF_URL "https://sappho.io - formerly maintained by http://www.ZombieX2.net/"
#define SMEXT_CONF_LOGTAG "NEO cURL"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions extension/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
FIX ME
if ( ! git clone https://github.com/alliedmodders/sourcemod --branch 1.11-dev sm-1.11 --recursive ); then
pushd sm-1.11 || echo "COULDNT CD TO SM???"; exit 255
echo "test"; pwd;
git reset --hard;
git fetch
git reset --hard FETCH_HEAD
git submodule foreach --recursive git reset --hard origin/HEAD
pwd
popd || echo "COULDNT POPD FROM $(pwd)???"; exit 255;
fi;
fi
File renamed without changes.
File renamed without changes.