diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml deleted file mode 100644 index b42baf7..0000000 --- a/.github/workflows/c-cpp.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: C/C++ CI - -on: - push: - branches: [ "master", "**" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: make - run: make diff --git a/.github/workflows/macos-matrix.yml b/.github/workflows/macos-matrix.yml new file mode 100644 index 0000000..3e3e5a2 --- /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.11.0 + 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]}" diff --git a/.github/workflows/macos-pre-release.yml b/.github/workflows/macos-pre-release.yml new file mode 100644 index 0000000..72f1872 --- /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.11.0 + 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-matrix.yml b/.github/workflows/ubuntu-matrix.yml new file mode 100644 index 0000000..db4aab1 --- /dev/null +++ b/.github/workflows/ubuntu-matrix.yml @@ -0,0 +1,49 @@ +name: ubuntu-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: + ubuntu-build_and_test: + strategy: + matrix: + os: [ubuntu-20.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: 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]}" diff --git a/.github/workflows/ubuntu-pre-release.yml b/.github/workflows/ubuntu-pre-release.yml new file mode 100644 index 0000000..bf33901 --- /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.11.0 + 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 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 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 > $@