diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 17 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.md | 20 | ||||
-rw-r--r-- | .github/actions/muslbuilder/Dockerfile | 162 | ||||
-rwxr-xr-x | .github/actions/muslbuilder/entrypoint.sh | 18 | ||||
-rw-r--r-- | .github/mlc_config.json | 10 | ||||
-rw-r--r-- | .github/workflows/bins.yml | 114 | ||||
-rw-r--r-- | .github/workflows/c-cpp.yml | 194 | ||||
-rw-r--r-- | .github/workflows/check-md-links.yml | 12 | ||||
-rw-r--r-- | .github/workflows/coverity.yml | 48 | ||||
-rw-r--r-- | .github/workflows/release.yml | 98 | ||||
-rw-r--r-- | .github/workflows/rpmbuild.yml | 49 | ||||
-rw-r--r-- | .github/workflows/tailer-ape.yml | 37 |
12 files changed, 779 insertions, 0 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..35976d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,17 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**lnav version** +v0.11.1 is the latest + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/actions/muslbuilder/Dockerfile b/.github/actions/muslbuilder/Dockerfile new file mode 100644 index 0000000..41d0910 --- /dev/null +++ b/.github/actions/muslbuilder/Dockerfile @@ -0,0 +1,162 @@ +FROM alpine:3.16 + +LABEL com.github.actions.name="C++ MUSL Builder Slim" +LABEL com.github.actions.description="Provides a C++ MUSL environment" +LABEL com.github.actions.icon="settings" +LABEL com.github.actions.color="orange" + +RUN apk update && apk add --no-cache \ + build-base \ + binutils \ + m4 \ + git \ + cmake \ + make \ + libgcc \ + musl-dev \ + gcc \ + g++ \ + lz4 \ + lz4-dev \ + lz4-static \ + zip \ + zstd \ + zstd-dev \ + zstd-static \ + perl \ + autoconf \ + automake \ + elfutils \ + elfutils-dev \ + libelf-static \ + libexecinfo-dev \ + libexecinfo-static \ + libtool \ + libunwind \ + libunwind-dev \ + libunwind-static \ + linux-headers + +ADD https://www.libarchive.org/downloads/libarchive-3.6.2.tar.gz / +ADD https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz / +ADD https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz / +ADD https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz / +ADD https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz / +ADD https://zlib.net/zlib-1.2.13.tar.gz / +ADD https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz / +ADD https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz / +ADD https://www.openssl.org/source/openssl-1.0.2n.tar.gz / +ADD https://www.libssh2.org/download/libssh2-1.11.0.tar.gz / +ADD https://curl.se/download/curl-8.1.2.tar.gz / +ADD https://tukaani.org/xz/xz-5.4.3.tar.gz / + +RUN mkdir -p /fake.root /packages /extract +ENV SQLITE_CFLAGS="\ + -DSQLITE_ENABLE_COLUMN_METADATA \ + -DSQLITE_SOUNDEX \ + -DSQLITE_ENABLE_DBSTAT_VTAB \ + -DSQLITE_ENABLE_API_ARMOR \ + -DSQLITE_ENABLE_JSON1 \ + -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \ + " + +ENV NCURSES_FALLBACKS="\ +ansi,\ +cygwin,\ +Eterm,\ +Eterm-256color,\ +gnome,\ +gnome-256color,\ +konsole,\ +konsole-256color,\ +linux,\ +putty,\ +rxvt,\ +rxvt-256color,\ +screen,\ +screen-16color,\ +screen-256color,\ +tmux,\ +tmux-256color,\ +vt100,\ +vt220,\ +xterm,\ +xterm-256color\ +" + +RUN cd /extract && for pkg in /*.tar.gz; do tar xvfz "$pkg"; done + +RUN cd /extract/bzip2-1.0.8 && make install PREFIX=/fake.root && make clean + +RUN cd /extract/zlib-* && ./configure --prefix=/fake.root && make -j2 && make install && make clean + +RUN cd /extract/xz-* && \ + ./configure --prefix=/fake.root \ + --disable-shared \ + "LDFLAGS=-L/fake.root/lib" \ + "CPPFLAGS=-I/fake.root/include" \ + && \ + make -j2 && \ + make install && make clean + +RUN cd /extract/libarchive-* && \ + ./configure --prefix=/fake.root \ + --disable-shared \ + "LDFLAGS=-L/fake.root/lib" \ + "CPPFLAGS=-I/fake.root/include" \ + && \ + make -j2 && \ + make install && make clean + +RUN cd /extract/make-4.2.1 && ./configure --prefix=/fake.root && make -j2 && make install && make clean +RUN cd /extract/readline-* && ./configure --prefix=/fake.root && make -j2 && make install && make clean + +RUN cd /extract/sqlite-* && \ + ./configure --disable-editline --prefix=/fake.root \ + CFLAGS="${SQLITE_CFLAGS}" \ + && \ + make -j2 && make install && make clean + +RUN cd /extract/openssl-* && \ + ./config --prefix=/fake.root -fPIC && \ + make -j2 && \ + make install && make clean + +RUN cd /extract/ncurses-* && \ + ./configure --prefix=/fake.root \ + --enable-ext-mouse \ + --enable-sigwinch \ + --with-default-terminfo-dir=/usr/share/terminfo \ + --enable-ext-colors \ + --enable-widec \ + --enable-termcap \ + --with-fallbacks=$NCURSES_FALLBACKS \ + && \ + make -j2 && make install && make clean + +RUN cd /extract/pcre2-* && \ + ./configure --prefix=/fake.root \ + --enable-jit \ + && \ + make -j2 && make install && make clean + +RUN cd /extract/libssh2-* && \ + ./configure --prefix=/fake.root \ + --with-libssl-prefix=/fake.root \ + --with-libz-prefix=/fake.root \ + "CPPFLAGS=-I/fake.root/include" \ + "LDFLAGS=-ldl -L/fake.root/lib" && \ + make -j2 && \ + make install && make clean + +RUN cd /extract/curl-* && \ + ./configure --prefix=/fake.root \ + --with-libssh2=/fake.root \ + --with-ssl=/fake.root \ + --with-zlib=/fake.root \ + "LDFLAGS=-ldl" && \ + make -j2 && \ + make install && make clean + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/muslbuilder/entrypoint.sh b/.github/actions/muslbuilder/entrypoint.sh new file mode 100755 index 0000000..7c40420 --- /dev/null +++ b/.github/actions/muslbuilder/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -Eeuxo pipefail + +cd $GITHUB_WORKSPACE +./autogen.sh +mkdir lbuild +cd lbuild +../configure \ + --with-libarchive=/fake.root \ + CFLAGS='-static -g1 -gz=zlib -no-pie -O2' \ + CXXFLAGS='-static -g1 -gz=zlib -U__unused -no-pie -O2' \ + LDFLAGS="-L/fake.root/lib" \ + CPPFLAGS="-I/fake.root/include" \ + LIBS="-L/fake.root/lib -lexecinfo -lssh2 -llzma -lssl -lcrypto -lz -llz4" \ + --enable-static \ + PATH="/fake.root/bin:${PATH}" +make -j2 diff --git a/.github/mlc_config.json b/.github/mlc_config.json new file mode 100644 index 0000000..be01fdb --- /dev/null +++ b/.github/mlc_config.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "^/assets" + }, + { + "pattern": "^https://archive.org" + } + ] +}
\ No newline at end of file diff --git a/.github/workflows/bins.yml b/.github/workflows/bins.yml new file mode 100644 index 0000000..27a9a04 --- /dev/null +++ b/.github/workflows/bins.yml @@ -0,0 +1,114 @@ +name: bins + +on: + push: + branches: + - master + paths-ignore: + - docs + - README.md + - NEWS.md + workflow_call: + inputs: + lnav_version_number: + description: The version number of the release + required: false + type: string + upload_url: + description: The URL to upload release assets + required: false + type: string + +jobs: + build-musl: + runs-on: ubuntu-latest + container: + image: tstack/lnav-build:1 + env: + LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }} + LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-x86_64-linux-musl.zip + steps: + - name: checkout + uses: actions/checkout@v3 + - name: make + run: /entrypoint.sh + - name: Build musl package + if: ${{ inputs.lnav_version_number != '' }} + run: >- + mkdir ${{ env.LNAV_BASENAME }} && + cd ${{ env.LNAV_BASENAME }} && + cp ../NEWS.md ../README . && + cp ../lbuild/src/lnav . && + cd .. && + zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }} + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: lnav-linux-musl-64bit.zip + # A file, directory or wildcard pattern that describes what to upload + path: lbuild/src/lnav + - name: Upload musl-binary archive + uses: actions/upload-release-asset@v1.0.2 + if: ${{ inputs.upload_url != '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ inputs.upload_url }} + asset_path: ${{ env.LNAV_ZIPNAME }} + asset_name: ${{ env.LNAV_ZIPNAME }} + asset_content_type: application/octet-stream + + build-macos: + runs-on: macos-12 + env: + LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }} + LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-x86_64-macos.zip + steps: + - name: checkout + uses: actions/checkout@v3 + - name: install packages + run: brew install pcre2 sqlite ncurses xz zstd readline libarchive curl autoconf automake + - name: autogen + run: ./autogen.sh + - name: configure + run: >- + ./configure --enable-static \ + --with-libcurl=/usr \ + --with-pcre2=$(brew --prefix pcre2) \ + --with-sqlite3=$(brew --prefix sqlite3) \ + "CXXFLAGS=-I$(brew --prefix ncurses)/include -g2 -O2" \ + 'CFLAGS=-O2 -g2' \ + "LDFLAGS=-L$(brew --prefix ncurses)/lib -L$(brew --prefix xz)/lib -L$(brew --prefix zstd)/lib/" \ + --with-readline=$(brew --prefix readline) \ + --with-libarchive=$(brew --prefix libarchive) \ + "LIBS=-llzma -lzstd -lbrotlidec-static -liconv -llz4" + - name: make + run: make -j2 + - name: Build macos package + if: ${{ inputs.lnav_version_number != '' }} + run: >- + mkdir ${{ env.LNAV_BASENAME }} && + cd ${{ env.LNAV_BASENAME }} && + cp ../NEWS.md ../README . && + cp ../src/lnav . && + cd .. && + zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }} + - name: Upload config.log artifact + uses: actions/upload-artifact@v3 + if: ${{ always() }} + with: + # Artifact name + name: config-log.zip + # A file, directory or wildcard pattern that describes what to upload + path: config.log + - name: Upload macos archive + uses: actions/upload-release-asset@v1.0.2 + if: ${{ inputs.upload_url != '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ inputs.upload_url }} + asset_path: ${{ env.LNAV_ZIPNAME }} + asset_name: ${{ env.LNAV_ZIPNAME }} + asset_content_type: application/octet-stream diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..66188af --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,194 @@ +name: ci-build + +on: + push: + branches: [ master ] + paths-ignore: + - docs + - README.md + - NEWS.md + pull_request: + branches: [ master ] + +jobs: + coverage: + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 +# - name: Update apt +# run: sudo apt-get update +# - name: Install packages +# run: sudo apt-get install libncursesw5-dev libpcre++-dev libsqlite3-dev libbz2-dev libcurl4-openssl-dev libreadline-dev zlib1g-dev lcov +# - name: install cpp-coveralls +# run: pip install --user cpp-coveralls + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure --disable-static --enable-code-coverage --enable-debug CFLAGS=-g3 CXXFLAGS=-g3 + - name: make + run: make -j3 + - name: make check + run: make check + - name: upload cover + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + TRAVIS_JOB_ID: ${{ github.run_id }}-${{ github.run_number }} + run: >- + coveralls + --exclude src/doctest.hh + --exclude src/fmtlib + --exclude src/ghc + --exclude src/k_merge_tree.h + --exclude src/mapbox + --exclude src/pugixml + --exclude src/base/result.h + --exclude src/safe + --exclude src/spookyhash + --exclude src/third-party + --exclude src/ww898 + --exclude src/yajl + --exclude test + --exclude src/data_scanner_re.cc + --gcov-options '\-lp' + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Update apt + run: sudo apt-get update + - name: Install packages + run: >- + sudo apt-get install -y + make + automake + autoconf + g++ + libpcre2-dev + libpcre3-dev + libncurses-dev + libsqlite3-dev + libbz2-dev + libcurl4-openssl-dev + libreadline-dev + tshark + zlib1g-dev + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure --disable-static + - name: make + run: make -j4 + - name: make distcheck + run: make distcheck -j4 || (test -e lnav-*/_build/sub/src/tailer/test-suite.log && cat lnav-*/_build/sub/src/tailer/test-suite.log && false) || (test -e lnav-*/_build/sub/test/test-suite.log && cat lnav-*/_build/sub/test/test-suite.log && false) + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: lnav-tot-linux-64bit.zip + # A file, directory or wildcard pattern that describes what to upload + path: src/lnav + + build-windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { icon: '🟦', sys: MSYS } + name: ${{ matrix.icon }} ${{ matrix.sys }} + defaults: + run: + shell: msys2 {0} + steps: + - name: '🧰 Checkout' + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + update: true + install: >- + autoconf + automake + gcc + git + make + zip + msys/libarchive-devel + msys/libbz2-devel + msys/libcurl-devel + msys/libidn2-devel + msys/liblzma-devel + msys/libreadline-devel + msys/libsqlite-devel + msys/libunistring-devel + msys/ncurses-devel + msys/pcre2-devel + msys/zlib-devel + - name: '🔧 Generate and configure' + run: | + set -x + ./autogen.sh + mkdir -p ../lnav-build + cd ../lnav-build + export PREFIX=$PWD/lnav + ../lnav/configure \ + --enable-static \ + LDFLAGS="-static" \ + CPPFLAGS="-I../src -I../../lnav/src -I../../lnav/src/fmtlib -O2 -DNCURSES_STATIC" \ + CXXFLAGS="-fPIC" \ + CFLAGS="-fPIC" \ + LIBS="-larchive -lssh2 -llzma -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon" \ + --sysconfdir=/etc \ + --prefix=$PREFIX || cat config.log + - name: '🚧 Make (do not use -j)' + run: | + set -x + cd ../lnav-build + make CFLAGS="-c" + strip -s src/lnav.exe + - name: '📦 Package for distribution' + run: | + set -x + cd ../lnav-build + export PREFIX=$PWD/lnav + make install + ldd $PREFIX/bin/lnav.exe | grep /usr | cut -d' ' -f3 | xargs -I {} cp {} $PREFIX/bin/ + mkdir -p lib/terminfo/78 + cp -r /usr/lib/terminfo/78/xterm-256color lib/terminfo/78/ + zip -r ../lnav/lnav-${{ github.ref_name }}-windows-amd64.zip lnav lib + - name: '💉 Basic test' + run: | + set -x + cd ../lnav-build + export PREFIX=$PWD/lnav + $PREFIX/bin/lnav.exe -n ../lnav/test/logfile_multiline.0 + - name: '⬆️ Upload a Build Artifact' + uses: actions/upload-artifact@v3 + with: + name: lnav-${{ github.ref_name }}-windows-amd64.zip + path: lnav-${{ github.ref_name }}-windows-amd64.zip + if-no-files-found: error +# - name: '🎁 Create Release' +# id: create_release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# tag_name: ${{ github.ref_name }} +# release_name: Release ${{ github.ref_name }} +# draft: false +# prerelease: false +# - name: '⬆️ Upload Release Asset' +# id: upload-release-asset +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps +# asset_path: ./lnav-${{ github.ref_name }}-windows-amd64.zip +# asset_name: lnav-${{ github.ref_name }}-windows-amd64.zip +# asset_content_type: application/zip diff --git a/.github/workflows/check-md-links.yml b/.github/workflows/check-md-links.yml new file mode 100644 index 0000000..f55b468 --- /dev/null +++ b/.github/workflows/check-md-links.yml @@ -0,0 +1,12 @@ +name: Check Markdown links + +on: push + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + config-file: '.github/mlc_config.json' diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 0000000..a081f33 --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,48 @@ +# GitHub actions workflow. +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions + +name: Coverity Scan + +on: + push: + branches: [ main ] + + schedule: + # The GH mirroring from Google GoB does not trigger push actions. + # Fire it once a week to provide some coverage. + - cron: '39 2 * * WED' + + # Allow for manual triggers from the web. + workflow_dispatch: + +jobs: + coverity: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Update apt + run: sudo apt-get update + - name: Install packages + run: >- + sudo apt-get install -y + make + automake + autoconf + g++ + libpcre3-dev + libncurses-dev + libsqlite3-dev + libbz2-dev + libcurl4-openssl-dev + libreadline-dev + tshark + zlib1g-dev + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure --disable-static + - uses: vapier/coverity-scan-action@v1 + with: + command: make -j$(getconf _NPROCESSORS_CONF) + email: ${{ secrets.COVERITY_SCAN_EMAIL }} + token: ${{ secrets.COVERITY_SCAN_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..650f053 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,98 @@ + +name: release +on: + push: + tags: + - '*' +jobs: + create-release: + name: create-release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.release.outputs.upload_url }} + lnav_version_number: ${{ env.LNAV_VERSION_NUMBER }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Make release notes + run: make -C release release-NEWS.md + - name: Get the release version from the tag + shell: bash + run: | + # Apparently, this is the right way to get a tag name. Really? + # + # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 + echo "LNAV_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "LNAV_VERSION_NUMBER=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + echo "version is: ${{ env.LNAV_VERSION }}" + - name: Create GitHub release + id: release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.LNAV_VERSION }} + release_name: ${{ env.LNAV_VERSION }} + body_path: release/release-NEWS.md + draft: true + + build-binaries: + name: build-binaries + needs: ['create-release'] + uses: ./.github/workflows/bins.yml + secrets: inherit + with: + lnav_version_number: ${{ needs.create-release.outputs.lnav_version_number }} + upload_url: ${{ needs.create-release.outputs.upload_url }} + + build-release: + name: build-release + needs: ['create-release'] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Update apt + run: sudo apt-get update + - name: Install packages + run: >- + sudo apt-get install -y + make + automake + autoconf + g++ + libpcre2-dev + libpcre3-dev + libncurses-dev + libsqlite3-dev + libbz2-dev + libcurl4-openssl-dev + libreadline-dev + zlib1g-dev + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure --disable-static + - name: make dist + run: >- + make dist dist-bzip2 && + mv -n lnav-*.tar.gz lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.gz && + mv -n lnav-*.tar.bz2 lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.bz2 + - name: Upload tgz archive + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.gz + asset_name: lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.gz + asset_content_type: application/octet-stream + - name: Upload tbz2 archive + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.bz2 + asset_name: lnav-${{ needs.create-release.outputs.lnav_version_number }}.tar.bz2 + asset_content_type: application/octet-stream diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml new file mode 100644 index 0000000..67e6d83 --- /dev/null +++ b/.github/workflows/rpmbuild.yml @@ -0,0 +1,49 @@ + +name: RPM Build + +on: + push: + branches: [ master ] + paths-ignore: + - docs + - README.md + - NEWS.md + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Get the release version from the tag + shell: bash + run: | + # Apparently, this is the right way to get a tag name. Really? + # + # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 + echo "LNAV_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "LNAV_VERSION_NUMBER=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + echo "version is: ${{ env.LNAV_VERSION }}" + make -C release lnav.spec + - name: build RPM package + id: rpm + uses: tstack/rpmbuild@master + with: + spec_file: "release/lnav.spec" + + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: Binary RPM + path: ${{ steps.rpm.outputs.rpm_dir_path }} + + - name: Push to packagecloud.io + uses: tstack/upload-packagecloud@main + if: github.ref_type == 'tag' + with: + userrepo: tstack/lnav + apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }} + packages: ${{ steps.rpm.outputs.rpm_dir_path }}x86_64 + rpmdists: el/8 diff --git a/.github/workflows/tailer-ape.yml b/.github/workflows/tailer-ape.yml new file mode 100644 index 0000000..e487507 --- /dev/null +++ b/.github/workflows/tailer-ape.yml @@ -0,0 +1,37 @@ +name: tailer-ape + +on: + push: + branches: [ master ] + paths-ignore: + - docs + - README.md + - NEWS.md + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: update apt + run: sudo apt-get update + - name: Install packages + run: >- + wget https://github.com/tstack/cosmopolitan/releases/download/v1.0stack/cosmopolitan-amalgamation-1.0-stack.zip && + unzip cosmopolitan-amalgamation-1.0-stack.zip + - name: Build + run: >- + gcc -g -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone + -fno-omit-frame-pointer -pg -mnop-mcount + -o tailer.dbg -I src/tailer + src/tailer/tailer.main.c src/tailer/tailer.c src/tailer/sha-256.c + -fuse-ld=bfd -Wl,-T,ape.lds + -include cosmopolitan.h crt.o ape.o cosmopolitan.a + - name: Objcopy + run: objcopy -S -O binary tailer.dbg src/tailer/tailer.ape + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + # Optional, but recommended + # Defaults to "Apply automatic changes" + commit_message: Update tailer + file_pattern: src/tailer/tailer.ape |