Workflow test (#47)

* Adds first test of create release when tag is pushed
* fix pixelmap read warnings
This commit is contained in:
Jeff Harris 2021-04-14 06:01:19 +12:00 committed by GitHub
parent 43f517234d
commit baafd76a09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 46 deletions

View File

@ -6,11 +6,11 @@ on:
types: published
jobs:
dethrace-linux:
build-linux:
runs-on: ubuntu-18.04
strategy:
matrix:
platform: [clang, gcc]
platform: [gcc]
steps:
- uses: actions/checkout@v2
@ -21,6 +21,10 @@ jobs:
- name: Set Git Info
id: gitinfo
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Obtain tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set variables
id: vars
@ -39,14 +43,14 @@ jobs:
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y libsdl2-dev > /dev/null
- name: Configure Dethrace
- name: Configure
env:
CC: ${{ steps.vars.outputs.cc }}
CXX: ${{ steps.vars.outputs.cxx }}
run: |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON -B build
- name: Build Dethrace
- name: Build
run: |
cmake --build build -- -j 4
@ -55,13 +59,14 @@ jobs:
cd build
ctest --verbose
- name: Create archives
- name: Create artifact
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir artifact
7z a artifact/dethrace-linux-${{ matrix.platform }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/dethrace
tar -czvf ${{ github.workspace }}/dethrace-${{ steps.get_version.version}}-linux-amd64.tar.gz ./build/dethrace
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dethrace-linux-${{ matrix.platform }}-x86_64
path: artifact
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# name: dethrace-${{ steps.get_version.version}}-linux-amd64.tar.gz
# path: artifacts/dethrace-${{ steps.get_version.version}}-linux-amd64.tar.gz

View File

@ -18,6 +18,10 @@ jobs:
id: gitinfo
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Obtain tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Install dependencies
run: |
brew install SDL2
@ -35,13 +39,7 @@ jobs:
cd build
ctest --verbose
- name: Create archives
- name: Create artifact
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir artifact
7z a artifact/dethrace-macos-${{ matrix.platform }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/dethrace
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dethrace-macos-${{ matrix.platform }}-x86_64
path: artifact
tar -czvf ${{ github.workspace }}/dethrace-${{ steps.get_version.version}}-darwin-amd64.tar.gz ./build/dethrace

35
.github/workflows/tag.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: release
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
needs: [build-linux]
steps:
- name: Obtain tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: true
release_name: ${{ steps.get_version.outputs.version }}
tag_name: ${{ github.ref }}
body: "hello world"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/dethrace-${{ steps.get_version.version}}-linux-amd64.tar.gz
asset_name: dethrace-${{ steps.get_version.version}}-linux-amd64.tar.gz
asset_content_type: application/octet-stream

View File

@ -54,13 +54,7 @@ jobs:
cmake --build build --config RelWithDebInfo
- name: Create archives
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
mkdir artifact
7z a artifact/dethrace-win-msvc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/dethrace.exe ./build/dethrace.pdb $TEMP/SDL2-2.0.12/lib/${{ steps.vars.outputs.sdl_path }}/SDL2.dll
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dethrace-win-msvc-${{ steps.vars.outputs.arc_path }}
path: artifact
7z a ${{ github.workspace }}/dethrace-win-msvc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/dethrace.exe ./build/dethrace.pdb $TEMP/SDL2-2.0.12/lib/${{ steps.vars.outputs.sdl_path }}/SDL2.dll

View File

@ -8,10 +8,17 @@
#include <stddef.h>
br_file_struct br_old_pixelmap_F;
br_file_enum pixelmap_type_F;
br_file_struct_member br_old_pixelmap_FM[7];
br_file_struct_member br_old_pixelmap_FM[7] = {
{ 13u, offsetof(br_pixelmap, type), "type", NULL },
{ 3u, offsetof(br_pixelmap, row_bytes), "row_bytes", NULL },
{ 3u, offsetof(br_pixelmap, width), "width", NULL },
{ 3u, offsetof(br_pixelmap, height), "height", NULL },
{ 3u, offsetof(br_pixelmap, origin_x), "origin_x", NULL },
{ 3u, offsetof(br_pixelmap, origin_y), "origin_y", NULL },
{ 17u, offsetof(br_pixelmap, identifier), "identifier", NULL }
};
br_file_struct_member br_pixelmap_FM[8] = {
{ 13u, offsetof(br_pixelmap, type), "type", NULL },
@ -20,19 +27,19 @@ br_file_struct_member br_pixelmap_FM[8] = {
{ 3u, offsetof(br_pixelmap, height), "height", NULL },
{ 3u, offsetof(br_pixelmap, origin_x), "origin_x", NULL },
{ 3u, offsetof(br_pixelmap, origin_y), "origin_y", NULL },
{ 3u, offsetof(br_pixelmap, mip_offset), "mip_offset", NULL },
{ 17u, offsetof(br_pixelmap, identifier), "identifier", NULL },
//not sure about this one...
{ 31436u, 7u, &br_pixelmap_FM, (void*)0x44 }
};
br_file_struct br_pixelmap_F = { "br_pixelmap", 7u, br_pixelmap_FM, sizeof(br_pixelmap) };
br_file_struct br_old_pixelmap_F = { "br_old_pixelmap", 7u, br_old_pixelmap_FM, sizeof(br_pixelmap) };
br_file_struct br_pixelmap_F = { "br_pixelmap", 8u, br_pixelmap_FM, sizeof(br_pixelmap) };
br_file_enum_member pixelmap_type_FM[15];
br_chunks_table_entry PixelmapLoadEntries[5] = {
{ 0u, 0u, &FopRead_END },
{ 3u, 0u, &FopRead_PIXELMAP },
{ 3u, 0u, &FopRead_OLD_PIXELMAP },
{ 33u, 0u, &FopRead_PIXELS },
{ 34u, 0u, &FopRead_ADD_MAP },
{ 4u, 168u, NULL }
{ 34u, 0u, &FopRead_ADD_MAP }
};
br_chunks_table PixelmapLoadTable = { 4, PixelmapLoadEntries };
@ -51,21 +58,21 @@ int FopWrite_PIXELMAP(br_datafile* df, br_pixelmap* pixelmap) {
int FopRead_OLD_PIXELMAP(br_datafile* df, br_uint_32 id, br_uint_32 length, br_uint_32 count) {
br_pixelmap* pp;
LOG_TRACE("(%p, %d, %d, %d)", df, id, length, count);
NOT_IMPLEMENTED();
pp = (br_pixelmap*)DevicePixelmapMemAllocate(3u, 0, 0, 0, 2);
df->res = pp;
df->prims->struct_read(df, &br_old_pixelmap_F, pp);
df->res = NULL;
pp->row_bytes = (pmTypeInfo[pp->type].bits >> 3) * pp->width;
DfPush(DF_PIXELMAP, pp, 1);
return 0;
}
// IDA: int __usercall FopRead_PIXELMAP@<EAX>(br_datafile *df@<EAX>, br_uint_32 id@<EDX>, br_uint_32 length@<EBX>, br_uint_32 count@<ECX>)
int FopRead_PIXELMAP(br_datafile* df, br_uint_32 id, br_uint_32 length, br_uint_32 count) {
br_pixelmap* pp;
LOG_TRACE9("(%p, %d, %d, %d)", df, id, length, count);
pp = (br_pixelmap*)DevicePixelmapMemAllocate(3u, 0, 0, 0, 2);
df->res = pp;
df->prims->struct_read(df, &br_pixelmap_F, pp);
df->res = NULL;
pp->row_bytes = (pmTypeInfo[pp->type].bits >> 3) * pp->width;
DfPush(DF_PIXELMAP, pp, 1);
return 0;
NOT_IMPLEMENTED();
}
// IDA: int __usercall FopWrite_PIXELS@<EAX>(br_datafile *df@<EAX>, br_pixelmap *pixelmap@<EDX>)