From 80cd32af5465117107a2a245fa877fa4e238a590 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 18:00:18 -0500 Subject: [PATCH 01/13] make: install - remove -D for better cross-platform compatibility use mkdir -p --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3000e1e..786ca12 100644 --- a/Makefile +++ b/Makefile @@ -55,9 +55,10 @@ nostril: $(HEADERS) $(OBJS) $(ARS) $(CC) $(CFLAGS) $(OBJS) $(ARS) -o $@ install: all - install -Dm644 doc/nostril.1 $(PREFIX)/share/man/man1/nostril.1 - install -Dm755 nostril $(PREFIX)/bin/nostril - install -Dm755 nostril-query $(PREFIX)/bin/nostril-query + mkdir -p $(PREFIX)/bin + install -m644 doc/nostril.1 $(PREFIX)/share/man/man1/nostril.1 + install -m755 nostril $(PREFIX)/bin/nostril + install -m755 nostril-query $(PREFIX)/bin/nostril-query config.h: configurator ./configurator > $@ From 04c8fc8264310c63314f54ad5dee5bd727871c5c Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 18:03:05 -0500 Subject: [PATCH 02/13] workflow: add ubuntu matrix [ubuntu-22.04, ubuntu-latest] add better test sequence --- .github/workflows/c-cpp.yml | 54 +++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b42baf7..0532916 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,17 +1,49 @@ -name: C/C++ CI +name: nostril-ubuntu-matrix +# Controls when the action will run. on: - push: - branches: [ "master", "**" ] pull_request: - branches: [ "master" ] + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + push: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: - - runs-on: ubuntu-latest - + ubuntu-build_and_test: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: make - run: make + - uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: printenv + run: | + printenv + - name: make + run: | + make + - name: sudo make install + run: | + sudo make install + - name: man nostril + run: | + man nostril + - name: sudo -su runner nostril + run: | + #pipe handles non-zero return from nostril default help + sudo -su runner nostril | echo "${PIPESTATUS[0]}" From f070574432e825c0d73b66416b1cd08777f290b7 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 19:02:28 -0500 Subject: [PATCH 03/13] renamed: .github/workflows/c-cpp.yml -> ubuntu-matrix.yml --- .github/workflows/{c-cpp.yml => ubuntu-matrix.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{c-cpp.yml => ubuntu-matrix.yml} (97%) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/ubuntu-matrix.yml similarity index 97% rename from .github/workflows/c-cpp.yml rename to .github/workflows/ubuntu-matrix.yml index 0532916..fc1147e 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/ubuntu-matrix.yml @@ -1,4 +1,4 @@ -name: nostril-ubuntu-matrix +name: ubuntu-matrix # Controls when the action will run. on: From 95f7af7982e081202b314a103998bc1f3ade79af Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 19:36:18 -0500 Subject: [PATCH 04/13] .github/workflows/macos-matrix.yml: add macos matrix --- .github/workflows/macos-matrix.yml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/macos-matrix.yml diff --git a/.github/workflows/macos-matrix.yml b/.github/workflows/macos-matrix.yml new file mode 100644 index 0000000..1dc3e3d --- /dev/null +++ b/.github/workflows/macos-matrix.yml @@ -0,0 +1,50 @@ +name: macos-matrix + +# Controls when the action will run. +on: + pull_request: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + push: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + macos-build_and_test: + strategy: + matrix: + os: [macos-latest, macos-11, macos-12] + runs-on: ${{ matrix.os }} + steps: + - uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: printenv + run: | + brew install libtool autoconf automake + printenv + - name: make + run: | + make + - name: sudo make install + run: | + sudo make install + - name: man nostril + run: | + man nostril + - name: sudo -su runner nostril + run: | + #pipe handles non-zero return from nostril default help + sudo -su runner nostril | echo "${PIPESTATUS[0]}" From 310594483e77799cc8995a11accc316cec120341 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 20:23:16 -0500 Subject: [PATCH 05/13] .gitignore: .DS_Store .DS_Store deps/.DS_Store --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 47f90da..dcbd75b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ scripts/nostr-req scripts/subnote /dist /version + +.DS_Store +deps/.DS_Store From 7369ec5bd398d4d3139cb04a96b9c0110a804a66 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Wed, 21 Dec 2022 01:00:02 -0500 Subject: [PATCH 06/13] workflow: ubuntu/macos pre-release matrix .github/workflows/ubuntu-pre-release.yml: .github/workflows/macos-pre-release.yml: --- .github/workflows/macos-pre-release.yml | 42 ++++++++++++++++++++++++ .github/workflows/ubuntu-pre-release.yml | 40 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/macos-pre-release.yml create mode 100644 .github/workflows/ubuntu-pre-release.yml diff --git a/.github/workflows/macos-pre-release.yml b/.github/workflows/macos-pre-release.yml new file mode 100644 index 0000000..99c43ef --- /dev/null +++ b/.github/workflows/macos-pre-release.yml @@ -0,0 +1,42 @@ +name: macos-pre-release + +# Controls when the action will run. +on: + push: + branches: + - 'master' + - '**-pre-release' + + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + pre-release: + strategy: + matrix: + os: [macos-11, macos-12, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: "build pre-release" + run: | + brew install libtool autoconf automake + printenv + make + shasum -a 256 nostril > nostril.sha256.txt + - name: Save state + run: echo "{name}={value}" >> $GITHUB_STATE + - name: Set output + run: echo "{name}={value}" >> $GITHUB_OUTPUT + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ matrix.os }} + prerelease: true + title: "Development Build" + files: | + nostril + nostril.sha256.txt diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml new file mode 100644 index 0000000..4b5b532 --- /dev/null +++ b/.github/workflows/ubuntu-pre-release.yml @@ -0,0 +1,40 @@ +name: ubuntu-pre-release + +# Controls when the action will run. +on: + push: + branches: + - 'master' + - '**-pre-release' + + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + pre-release: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: "build pre-release" + run: | + make + shasum -a 256 nostril > nostril.sha256.txt + - name: Save state + run: echo "{name}={value}" >> $GITHUB_STATE + - name: Set output + run: echo "{name}={value}" >> $GITHUB_OUTPUT + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ matrix.os }} + prerelease: true + title: "Development Build" + files: | + nostril + nostril.sha256.txt From 89cee333053df0531e06812ff838c27c614c3179 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 25 Dec 2022 19:12:41 -0500 Subject: [PATCH 07/13] workflows: update to styfle/cancel-workflow-action@0.11.0 --- .github/workflows/macos-matrix.yml | 2 +- .github/workflows/macos-pre-release.yml | 2 +- .github/workflows/ubuntu-matrix.yml | 2 +- .github/workflows/ubuntu-pre-release.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos-matrix.yml b/.github/workflows/macos-matrix.yml index 1dc3e3d..3e3e5a2 100644 --- a/.github/workflows/macos-matrix.yml +++ b/.github/workflows/macos-matrix.yml @@ -27,7 +27,7 @@ jobs: os: [macos-latest, macos-11, macos-12] runs-on: ${{ matrix.os }} steps: - - uses: styfle/cancel-workflow-action@0.9.1 + - uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 diff --git a/.github/workflows/macos-pre-release.yml b/.github/workflows/macos-pre-release.yml index 99c43ef..72f1872 100644 --- a/.github/workflows/macos-pre-release.yml +++ b/.github/workflows/macos-pre-release.yml @@ -17,7 +17,7 @@ jobs: os: [macos-11, macos-12, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: styfle/cancel-workflow-action@0.9.1 + - uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 diff --git a/.github/workflows/ubuntu-matrix.yml b/.github/workflows/ubuntu-matrix.yml index fc1147e..db4aab1 100644 --- a/.github/workflows/ubuntu-matrix.yml +++ b/.github/workflows/ubuntu-matrix.yml @@ -27,7 +27,7 @@ jobs: os: [ubuntu-20.04, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: styfle/cancel-workflow-action@0.9.1 + - uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml index 4b5b532..bf33901 100644 --- a/.github/workflows/ubuntu-pre-release.yml +++ b/.github/workflows/ubuntu-pre-release.yml @@ -17,7 +17,7 @@ jobs: os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: styfle/cancel-workflow-action@0.9.1 + - uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 From eb859da6a2c8e47e303be35d36493729a7d85da3 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 25 Dec 2022 23:14:46 -0500 Subject: [PATCH 08/13] workflows: pre-release trigger on **pre-release** branches for testing --- .github/workflows/macos-pre-release.yml | 2 +- .github/workflows/ubuntu-pre-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-pre-release.yml b/.github/workflows/macos-pre-release.yml index 72f1872..ea76603 100644 --- a/.github/workflows/macos-pre-release.yml +++ b/.github/workflows/macos-pre-release.yml @@ -5,7 +5,7 @@ on: push: branches: - 'master' - - '**-pre-release' + - '**pre-release**' workflow_dispatch: diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml index bf33901..4434783 100644 --- a/.github/workflows/ubuntu-pre-release.yml +++ b/.github/workflows/ubuntu-pre-release.yml @@ -5,7 +5,7 @@ on: push: branches: - 'master' - - '**-pre-release' + - '**pre-release**' workflow_dispatch: From 5d55b929d3de0c3a71484b160a28f019e3ad406c Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 25 Dec 2022 23:27:03 -0500 Subject: [PATCH 09/13] workflows: ubuntu/macos-release.yml builds push detects version tags detect v*.*.* and version release candidates v*.*.*-rc** --- .github/workflows/macos-pre-release.yml | 13 +++++-- .github/workflows/macos-release.yml | 47 ++++++++++++++++++++++++ .github/workflows/ubuntu-pre-release.yml | 14 +++++-- .github/workflows/ubuntu-release.yml | 46 +++++++++++++++++++++++ 4 files changed, 112 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/macos-release.yml create mode 100644 .github/workflows/ubuntu-release.yml diff --git a/.github/workflows/macos-pre-release.yml b/.github/workflows/macos-pre-release.yml index ea76603..0f6b373 100644 --- a/.github/workflows/macos-pre-release.yml +++ b/.github/workflows/macos-pre-release.yml @@ -21,12 +21,18 @@ jobs: with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - - name: "build pre-release" + - name: "printenv" run: | brew install libtool autoconf automake printenv + - name: "Build pre-release" + run: | make - shasum -a 256 nostril > nostril.sha256.txt + mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-query-$RUNNER_OS-$RUNNER_ARCH > nostril-query-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + ls -a - name: Save state run: echo "{name}={value}" >> $GITHUB_STATE - name: Set output @@ -38,5 +44,4 @@ jobs: prerelease: true title: "Development Build" files: | - nostril - nostril.sha256.txt + nostril-* diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml new file mode 100644 index 0000000..3fbaf9b --- /dev/null +++ b/.github/workflows/macos-release.yml @@ -0,0 +1,47 @@ +name: macos-release + +# Controls when the action will run. +on: + push: + tags: + - "v*" + - "v*.*.*-rc**" + + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + release: + strategy: + matrix: + os: [macos-11, macos-12, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: "printenv" + run: | + brew install libtool autoconf automake + printenv + - name: "Build release" + run: | + make + mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-query-$RUNNER_OS-$RUNNER_ARCH > nostril-query-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + ls -a + - name: Save state + run: echo "{name}={value}" >> $GITHUB_STATE + - name: Set output + run: echo "{name}={value}" >> $GITHUB_OUTPUT + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ matrix.os }} + prerelease: false + title: "Release Build" + files: | + nostril-* diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml index 4434783..1b72cad 100644 --- a/.github/workflows/ubuntu-pre-release.yml +++ b/.github/workflows/ubuntu-pre-release.yml @@ -21,10 +21,17 @@ jobs: with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - - name: "build pre-release" + - name: "printenv" + run: | + printenv + - name: "Build pre-release" run: | make - shasum -a 256 nostril > nostril.sha256.txt + mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-query-$RUNNER_OS-$RUNNER_ARCH > nostril-query-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + ls -a - name: Save state run: echo "{name}={value}" >> $GITHUB_STATE - name: Set output @@ -36,5 +43,4 @@ jobs: prerelease: true title: "Development Build" files: | - nostril - nostril.sha256.txt + nostril-* diff --git a/.github/workflows/ubuntu-release.yml b/.github/workflows/ubuntu-release.yml new file mode 100644 index 0000000..667cddc --- /dev/null +++ b/.github/workflows/ubuntu-release.yml @@ -0,0 +1,46 @@ +name: ubuntu-release + +# Controls when the action will run. +on: + push: + tags: + - "v*" + - "v*.*.*-rc**" + + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + release: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: "printenv" + run: | + printenv + - name: "Build release" + run: | + make + mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH + shasum -a 256 nostril-query-$RUNNER_OS-$RUNNER_ARCH > nostril-query-$RUNNER_OS-$RUNNER_ARCH.sha256.txt + ls -a + - name: Save state + run: echo "{name}={value}" >> $GITHUB_STATE + - name: Set output + run: echo "{name}={value}" >> $GITHUB_OUTPUT + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ matrix.os }} + prerelease: false + title: "Release Build" + files: | + nostril-* From a39f1bca95917fc9f01c498da6003728d63d4542 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Wed, 1 Feb 2023 21:19:54 -0500 Subject: [PATCH 10/13] make: help: verbose help --- Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 786ca12..12ab4c4 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,19 @@ ARS = libsecp256k1.a SUBMODULES = deps/secp256k1 -all: nostril docs +default: + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) +help:## print verbose help + @echo '' + @echo 'Usage: make [TARGET] [EXTRA_ARGUMENTS]' + @echo '' + @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ': ' | sed -e 's/^/ /' ## verbose help ideas + @sed -n 's/^## //p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' + @echo "" + @echo "Useful Commands:" + @echo "" + +all: nostril docs## nostril docs docs: doc/nostril.1 @@ -73,4 +85,4 @@ clean: tags: fake ctags *.c *.h -.PHONY: fake +.PHONY: fake nostril From f202ebcdde2b2ea7b57b4bc51991ab55fba26516 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Sun, 23 Jul 2023 12:44:52 -0400 Subject: [PATCH 11/13] .github/workflows/... building --- .github/workflows/ubuntu-matrix.yml | 20 +++++++++++++++----- .github/workflows/ubuntu-pre-release.yml | 15 +++++++++++---- .github/workflows/ubuntu-release.yml | 15 +++++++++++---- .gitmodules | 3 +++ Makefile | 2 ++ nostril.c | 2 +- 6 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ubuntu-matrix.yml b/.github/workflows/ubuntu-matrix.yml index db4aab1..f269c86 100644 --- a/.github/workflows/ubuntu-matrix.yml +++ b/.github/workflows/ubuntu-matrix.yml @@ -28,14 +28,23 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.11.0 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - - uses: actions/checkout@v2 - - name: printenv + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + submodules: 'recursive' + set-safe-directory: 'true' + - name: printenv && sudo apt update && sudo apt install scdoc -y run: | - printenv + printenv && sudo apt update && sudo apt install scdoc -y + - name: rm -rf deps + run: | + rm -rf deps - name: make run: | + mkdir -p /usr/local/share/man/man1/nostril.1 make - name: sudo make install run: | @@ -43,7 +52,8 @@ jobs: - name: man nostril run: | man nostril - - name: sudo -su runner nostril + - name: sudo ./nostril run: | #pipe handles non-zero return from nostril default help - sudo -su runner nostril | echo "${PIPESTATUS[0]}" + file nostril + sudo ./nostril >/dev/null | echo "${PIPESTATUS[0]}" diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml index 1b72cad..8096f0b 100644 --- a/.github/workflows/ubuntu-pre-release.yml +++ b/.github/workflows/ubuntu-pre-release.yml @@ -18,15 +18,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.11.0 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - - uses: actions/checkout@v2 - - name: "printenv" + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + submodules: 'recursive' + set-safe-directory: 'true' + - name: printenv && sudo apt update && sudo apt install scdoc -y run: | - printenv + printenv && sudo apt update && sudo apt install scdoc -y - name: "Build pre-release" run: | - make + mkdir -p /usr/local/share/man/man1/nostril.1 + make nostril mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH @@ -37,6 +43,7 @@ jobs: - name: Set output run: echo "{name}={value}" >> $GITHUB_OUTPUT - uses: "marvinpinto/action-automatic-releases@latest" + if: ${{ !env.ACT }} with: repo_token: "${{ secrets.GITHUB_TOKEN }}" automatic_release_tag: ${{ matrix.os }} diff --git a/.github/workflows/ubuntu-release.yml b/.github/workflows/ubuntu-release.yml index 667cddc..f59e20a 100644 --- a/.github/workflows/ubuntu-release.yml +++ b/.github/workflows/ubuntu-release.yml @@ -18,15 +18,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.11.0 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - - uses: actions/checkout@v2 - - name: "printenv" + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + submodules: 'recursive' + set-safe-directory: 'true' + - name: printenv && sudo apt update && sudo apt install scdoc -y run: | - printenv + printenv && sudo apt update && sudo apt install scdoc -y - name: "Build release" run: | - make + mkdir -p /usr/local/share/man/man1/nostril.1 + make nostril mv nostril nostril-$RUNNER_OS-$RUNNER_ARCH shasum -a 256 nostril-$RUNNER_OS-$RUNNER_ARCH > nostril-$RUNNER_OS-$RUNNER_ARCH.sha256.txt mv nostril-query nostril-query-$RUNNER_OS-$RUNNER_ARCH @@ -37,6 +43,7 @@ jobs: - name: Set output run: echo "{name}={value}" >> $GITHUB_OUTPUT - uses: "marvinpinto/action-automatic-releases@latest" + if: ${{ !env.ACT }} with: repo_token: "${{ secrets.GITHUB_TOKEN }}" automatic_release_tag: ${{ matrix.os }} diff --git a/.gitmodules b/.gitmodules index 967defe..0f87e1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "deps/secp256k1"] path = deps/secp256k1 url = https://github.com/bitcoin-core/secp256k1 + ignore = dirty + branch = master + depth = shallow diff --git a/Makefile b/Makefile index 12ab4c4..208af89 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,8 @@ deps/secp256k1/include/secp256k1.h: deps/secp256k1/.git deps/secp256k1/configure: deps/secp256k1/.git cd deps/secp256k1; \ + automake --add-missing; \ + autoreconf; \ ./autogen.sh deps/secp256k1/config.log: deps/secp256k1/configure diff --git a/nostril.c b/nostril.c index 5bd279e..56e5f29 100644 --- a/nostril.c +++ b/nostril.c @@ -97,7 +97,7 @@ void usage() printf(" -e shorthand for --tag e \n"); printf(" -p shorthand for --tag p \n"); printf(" -t shorthand for --tag t \n"); - exit(1); + exit(0); } From 93c9616d9cda64ae7315394bba80b8e6f0288777 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 1 Aug 2023 20:25:13 -0400 Subject: [PATCH 12/13] CMakeLists.txt:make install --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05450b4..1d42756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,8 +71,18 @@ target_link_libraries (nostril ${lib_dep}) add_custom_command( TARGET configurator POST_BUILD - COMMAND configurator > config.h + COMMAND configurator > config.h COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/config.h" ${CMAKE_SOURCE_DIR} COMMENT "generating config.h" ) +#////////////////////////// +# Install +#////////////////////////// + +install(TARGETS nostril + CONFIGURATIONS Debug + RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin) +install(TARGETS nostril + CONFIGURATIONS Release + RUNTIME DESTINATION /usr/local/bin) From 2c481cd581487be1005431f5163a1187202b4160 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 1 Aug 2023 20:31:16 -0400 Subject: [PATCH 13/13] CMakeLists.txt: Debug/Release CMAKE_BUILD_TYPE --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d42756..a566d58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ else() cmake_minimum_required(VERSION 3.15) endif() set(CMAKE_BUILD_TYPE Debug) +option(BUILD_RELEASE "BUILD_RELEASE" ON) +if(BUILD_RELEASE) + set(CMAKE_BUILD_TYPE Release) +endif() + project (nostril C) include_directories(${CMAKE_SOURCE_DIR}/ext/secp256k1/include)