瀏覽代碼

Add release windows build

tags/v1.8.0
Xerbo 4 年之前
父節點
當前提交
eb61a550c1
共有 5 個檔案被更改,包括 44 行新增4 行删除
  1. +1
    -1
      .github/workflows/win_debug.yml
  2. +30
    -0
      .github/workflows/win_release.yml
  3. +2
    -0
      README.md
  4. +6
    -1
      build_windows.sh
  5. +5
    -2
      src/main.c

+ 1
- 1
.github/workflows/win_debug.yml 查看文件

@@ -21,7 +21,7 @@ jobs:
- name: Run build script
shell: bash
working-directory: ${{runner.workspace}}
run: cd $GITHUB_WORKSPACE && ./build_windows.sh
run: cd $GITHUB_WORKSPACE && ./build_windows.sh $BUILD_TYPE

- name: Upload compilied binary
uses: actions/upload-artifact@v2


+ 30
- 0
.github/workflows/win_release.yml 查看文件

@@ -0,0 +1,30 @@
name: x86 Win Release

on:
push:
branches:
- master
env:
BUILD_TYPE: Debug

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install dependencies
# The user does not run as root
run: sudo apt install wget cmake make mingw-w64 git unzip libsndfile-dev

- name: Run build script
shell: bash
working-directory: ${{runner.workspace}}
run: cd $GITHUB_WORKSPACE && ./build_windows.sh $BUILD_TYPE

- name: Upload compilied binary
uses: actions/upload-artifact@v2
with:
name: Debug build
path: ${{runner.workspace}}/aptdec/winbuild/aptdec-1.7.0.zip

+ 2
- 0
README.md 查看文件

@@ -4,6 +4,8 @@ Copyright (c) 2004-2009 Thierry Leconte (F4DWV), Xerbo (xerbo@protonmail.com) 20

![x86 Release](https://github.com/Xerbo/aptdec/workflows/x86%20Release/badge.svg?branch=master)
![x86 Debug](https://github.com/Xerbo/aptdec/workflows/x86%20Debug/badge.svg?branch=devel)
![x86 Win Release](https://github.com/Xerbo/aptdec/workflows/x86%20Win%20Release/badge.svg?branch=master)
![x86 Win Debug](https://github.com/Xerbo/aptdec/workflows/x86%20Win%20Debug/badge.svg?branch=devel)

## Introduction



+ 6
- 1
build_windows.sh 查看文件

@@ -40,8 +40,13 @@ cp "libsndfile-1.0.29-win64/lib/sndfile.lib" $TEMP_PATH/lib/sndfile.lib
# Copy DLL's into root for CPack
cp $TEMP_PATH/bin/*.dll ../

buildtype="Debug"
if [[ "$1" == "Release" ]]; then
buildtype="Release"
fi

# Build aptdec
mkdir -p winbuild && cd winbuild
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH ..
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$TEMP_PATH ..
make -j 4
make package

+ 5
- 2
src/main.c 查看文件

@@ -47,7 +47,7 @@ static int initsnd(char *filename);
int getsample(float *sample, int nb);
static int processAudio(char *filename, options_t *opts);

int main(int argc, char **argv) {
int main(int argc, const char **argv) {
//fprintf(stderr, VERSION"\n");

// Check if there are actually any input files
@@ -97,7 +97,10 @@ int main(int argc, char **argv) {

// Actually decode the files
for (int i = 0; i < argc; i++) {
processAudio(argv[i], &opts);
// Convert from a `const char *` to a normal `char *`
char *filename = NULL;
memcpy(filename, argv[i], strlen(argv[i]));
processAudio(filename, &opts);
}

return 0;


Loading…
取消
儲存