From dc16905adf637a621809d563d1f87c3047d11c06 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:34:17 +0100 Subject: [PATCH] gha: Add `release` workflow The new workflow runs checks outlined in the `doc/release-process.md`. --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 441cf41ee9..5d40125abc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: - '**' concurrency: - group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }} + group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }} cancel-in-progress: true env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..b374620956 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +# See: https://github.com/bitcoin-core/secp256k1/blob/master/doc/release-process.md +name: Release +on: + pull_request: + push: + branches: ['**'] + tags-ignore: ['**'] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }} + cancel-in-progress: true + +jobs: + release: + runs-on: ubuntu-latest + # The `startsWith` and `contains` functions are not case sensitive. + if: > + startsWith(github.event.pull_request.head.commit.message, 'release: Prepare for ') || + contains(github.event.head_commit.message, 'release: Prepare for ') || + github.event_name == 'workflow_dispatch' + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - run: ./autogen.sh && ./configure --enable-dev-mode && make distcheck + + - name: Check installation with Autotools + env: + CI_INSTALL: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }} + run: | + ./autogen.sh && ./configure --prefix=${{ env.CI_INSTALL }} && make clean && make install && ls -l ${{ env.CI_INSTALL }}/include ${{ env.CI_INSTALL }}/lib + gcc -o ecdsa examples/ecdsa.c $(PKG_CONFIG_PATH=${{ env.CI_INSTALL }}/lib/pkgconfig pkg-config --cflags --libs libsecp256k1) -Wl,-rpath,"${{ env.CI_INSTALL }}/lib" && ./ecdsa + + - name: Check installation with CMake + env: + CI_BUILD: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }}/build + CI_INSTALL: ${{ runner.temp }}/${{ github.run_id }}${{ github.action }}/install + run: | + cmake -B ${{ env.CI_BUILD }} -DCMAKE_INSTALL_PREFIX=${{ env.CI_INSTALL }} && cmake --build ${{ env.CI_BUILD }} --target install && ls -l ${{ env.CI_INSTALL }}/include ${{ env.CI_INSTALL }}/lib* + gcc -o ecdsa examples/ecdsa.c -I ${{ env.CI_INSTALL }}/include -L ${{ env.CI_INSTALL }}/lib*/ -l secp256k1 -Wl,-rpath,"${{ env.CI_INSTALL }}/lib",-rpath,"${{ env.CI_INSTALL }}/lib64" && ./ecdsa