Compare commits
15 Commits
610df6869f
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 95deda1f59 | |||
| 3f3d1e1e5d | |||
| 877b8e9a04 | |||
| 4ce59f537c | |||
| 7d13bde13b | |||
| 3aa792a620 | |||
| c0b667847c | |||
| ce2956f072 | |||
| a1182016af | |||
| 59423e294a | |||
| ef5c9376a9 | |||
| eeed101228 | |||
| 6b88d7e3fe | |||
| 58dab46902 | |||
| 269ee5d9ab |
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
|
RUNTIME_ASSERT = true
|
||||||
|
|
||||||
# Internal variables
|
# Internal variables
|
||||||
override CFLAGS = -Wall -Wextra -Werror -pedantic -Isrc -D_LARGEFILE64_SOURCE
|
override CFLAGS = -Wall -Wextra -Werror -pedantic -Isrc
|
||||||
override LIBFLAGS = -fPIC
|
override LIBFLAGS = -fPIC
|
||||||
override CSTD := -std=gnu11
|
override CSTD := -std=gnu11
|
||||||
override CXXSTD := -std=gnu++11
|
override CXXSTD := -std=gnu++11
|
||||||
@@ -46,7 +46,7 @@ endif
|
|||||||
|
|
||||||
# Disable runtime asserts
|
# Disable runtime asserts
|
||||||
ifeq ($(RUNTIME_ASSERT), false)
|
ifeq ($(RUNTIME_ASSERT), false)
|
||||||
override BUILD_FLAGS += WAPP_NO_RUNTIME_ASSERT
|
override BUILD_FLAGS += -DWAPP_NO_RUNTIME_ASSERT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CC),gcc)
|
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
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#define lseek64 lseek
|
#define lseek64 lseek
|
||||||
#endif // !WAPP_PLATFORM_APPLE
|
#endif // !WAPP_PLATFORM_APPLE
|
||||||
|
|
||||||
|
#define __USE_LARGEFILE64
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|||||||
@@ -20,16 +20,13 @@ struct WUUID {
|
|||||||
Str8 uuid;
|
Str8 uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WAPP_PLATFORM_CPP
|
// TODO (Abdelrahman): Update UUID implementation to work properly with C++ and tests for validation
|
||||||
#define wapp_uuid_gen_uuid4() ([&](){
|
|
||||||
wapp_persist WUUID id = wapp_uuid_create();
|
|
||||||
return *wapp_uuid_init_uuid4(&id);
|
|
||||||
}())
|
|
||||||
#define wapp_uuid_create() (WUUID{wapp_str8_buf(UUID_BUF_LENGTH)})
|
|
||||||
#else
|
|
||||||
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
||||||
|
|
||||||
|
/* Low level UUID API */
|
||||||
|
|
||||||
#define wapp_uuid_create() ((WUUID){.uuid = wapp_str8_buf(UUID_BUF_LENGTH)})
|
#define wapp_uuid_create() ((WUUID){.uuid = wapp_str8_buf(UUID_BUF_LENGTH)})
|
||||||
#endif
|
|
||||||
|
|
||||||
// Just returns the same pointer that was passed in with the UUID initialised.
|
// Just returns the same pointer that was passed in with the UUID initialised.
|
||||||
// Fails when passed a NULL pointer.
|
// Fails when passed a NULL pointer.
|
||||||
|
|||||||
Reference in New Issue
Block a user