Compare commits
18 Commits
3d3452f523
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 95deda1f59 | |||
| 3f3d1e1e5d | |||
| 877b8e9a04 | |||
| 4ce59f537c | |||
| 7d13bde13b | |||
| 3aa792a620 | |||
| c0b667847c | |||
| ce2956f072 | |||
| a1182016af | |||
| 59423e294a | |||
| ef5c9376a9 | |||
| eeed101228 | |||
| 6b88d7e3fe | |||
| 58dab46902 | |||
| 269ee5d9ab | |||
| 610df6869f | |||
| 1cdb08a81a | |||
| 8d9ef89329 |
81
.gitea/workflows/release.yml
Normal file
81
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # or your default branch
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # fetch full history
|
||||
tags: true # fetch all tags
|
||||
|
||||
- name: Check/Create Tag
|
||||
id: tag
|
||||
run: |
|
||||
VERSION=$(cat VERSION | tr -d '[:space:]') # read version and trim whitespace
|
||||
echo "Version: $VERSION"
|
||||
|
||||
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
||||
echo "Tag v$VERSION already exists. Skipping release."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Tag does not exist → create it
|
||||
echo "Creating tag v$VERSION"
|
||||
git tag "v$VERSION"
|
||||
git push origin "v$VERSION"
|
||||
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build Artifacts
|
||||
if: steps.tag.outputs.version
|
||||
run: |
|
||||
chmod +x ./package
|
||||
./package
|
||||
ls -l dist/
|
||||
|
||||
- name: Create Release
|
||||
if: steps.tag.outputs.version
|
||||
id: create_release
|
||||
run: |
|
||||
VERSION="${{ steps.tag.outputs.version }}"
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases" \
|
||||
-d '{
|
||||
"tag_name": "v'"$VERSION"'",
|
||||
"name": "wapp-v'"$VERSION"'",
|
||||
"body": "Automated release for wapp-v'"$VERSION"'",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}')
|
||||
|
||||
echo "$RESPONSE"
|
||||
RELEASE_ID=$(echo $RESPONSE | jq -r '.id')
|
||||
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: steps.tag.outputs.version
|
||||
run: |
|
||||
RELEASE_ID="${{ steps.create_release.outputs.release_id }}"
|
||||
for FILE in dist/*; do
|
||||
FILENAME=$(basename "$FILE")
|
||||
echo "Uploading $FILENAME"
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$FILE" \
|
||||
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets?name=$FILENAME"
|
||||
done
|
||||
|
||||
- name: Cleanup
|
||||
if: steps.tag.outputs.version
|
||||
run: rm -rf dist/*
|
||||
4
Makefile
4
Makefile
@@ -10,7 +10,7 @@ INSTALL_PREFIX = dist
|
||||
RUNTIME_ASSERT = true
|
||||
|
||||
# Internal variables
|
||||
override CFLAGS = -Wall -Wextra -Werror -pedantic -Isrc -D_LARGEFILE64_SOURCE
|
||||
override CFLAGS = -Wall -Wextra -Werror -pedantic -Isrc
|
||||
override LIBFLAGS = -fPIC
|
||||
override CSTD := -std=gnu11
|
||||
override CXXSTD := -std=gnu++11
|
||||
@@ -46,7 +46,7 @@ endif
|
||||
|
||||
# Disable runtime asserts
|
||||
ifeq ($(RUNTIME_ASSERT), false)
|
||||
override BUILD_FLAGS += WAPP_NO_RUNTIME_ASSERT
|
||||
override BUILD_FLAGS += -DWAPP_NO_RUNTIME_ASSERT
|
||||
endif
|
||||
|
||||
ifeq ($(CC),gcc)
|
||||
|
||||
11
package
Executable file
11
package
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp -r src wapp
|
||||
|
||||
mkdir -p dist
|
||||
|
||||
ARCHIVE_NAME="wapp-v$(cat VERSION)"
|
||||
tar -czvf dist/$ARCHIVE_NAME.tar.gz wapp
|
||||
zip -r dist/$ARCHIVE_NAME.zip wapp
|
||||
|
||||
rm -rf wapp
|
||||
@@ -54,7 +54,7 @@ typedef GenericQueue Str8Queue;
|
||||
}())
|
||||
#define wapp_queue_alloc(TYPE, ALLOCATOR_PTR, CAPACITY) ([&]() { \
|
||||
wapp_persist GenericQueue queue = { \
|
||||
wapp_array_alloc_capacity(TYPE, ALLOCATOR_PTR, CAPACITY, ARRAY_INIT_FILLED) \
|
||||
wapp_array_alloc_capacity(TYPE, ALLOCATOR_PTR, CAPACITY, ARRAY_INIT_FILLED), \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define lseek64 lseek
|
||||
#endif // !WAPP_PLATFORM_APPLE
|
||||
|
||||
#define __USE_LARGEFILE64
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -20,6 +20,8 @@ struct WUUID {
|
||||
Str8 uuid;
|
||||
};
|
||||
|
||||
// TODO (Abdelrahman): Update UUID implementation to work properly with C++ and tests for validation
|
||||
|
||||
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
||||
|
||||
/* Low level UUID API */
|
||||
|
||||
Reference in New Issue
Block a user