diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6bfd791..8660fe8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,10 @@ - "**.md" workflow_dispatch: +# https://github.com/softprops/action-gh-release/issues/236 +permissions: + contents: write + jobs: test: runs-on: ubuntu-latest @@ -31,3 +35,34 @@ jobs: - uses: codecov/codecov-action@v3 with: gcov: true + build: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + sudo apt update + sudo apt install check + # gcc-mingw-w64-x86-64-win32 + - name: Build + run: | + autoreconf -vif + ./configure + make dist + make + # ./configure --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 + # make + - uses: actions/upload-artifact@v3 + if: ${{ ! startsWith(github.ref, 'refs/tags/') }} + with: + path: | + x264 + *.tar.gz + - uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + # body_path: CHANGELOG.md + files: | + x264 + *.tar.gz diff --git a/CMakeLists.txt b/CMakeLists.txt index 84438c9..6b858e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 3.10) +if(DEFINED ENV{GITHUB_REF_NAME}) + set(VERSION $ENV{GITHUB_REF_NAME}) +else() + set(VERSION 0.0.0.0) +endif() project( x264-dsp - VERSION 0.0.0.0 + VERSION ${VERSION} DESCRIPTION x264-dsp HOMEPAGE_URL https://github.com/Freed-Wu/x264-dsp LANGUAGES C ASM)