Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.0.2 #6

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .github/workflows/buldrpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: RPM Build and Upload
on:
pull_request:
branches:
- 'release/*'
- 'main'
- 'master'

jobs:
build:
Expand All @@ -16,6 +17,11 @@ jobs:
fetch-depth: 0
ref:

- name: Set Git identity
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"

- name: Check Branch and Target
if: >
github.event_name == 'pull_request' &&
Expand Down Expand Up @@ -44,16 +50,23 @@ jobs:
git pull origin $DEFAULT_BRANCH
env:
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}


- name: Create tag
run: |
git fetch --all --tags
tag_name="${{ env.VERSION }}"
if ! git rev-parse -q --verify "refs/tags/$tag_name" >/dev/null; then
git tag $tag
fi
env:
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}

- name: Set Version & pull tag
id: version
run: |
VERSION=$(echo ${{ github.head_ref }} | sed 's/release\///')

echo "VERSION=${VERSION}" >> $GITHUB_ENV
git pull origin $VERSION

echo "Set VERSION to $VERSION"

- name: Comment version BUMP
uses: actions/github-script@v5
Expand Down Expand Up @@ -114,11 +127,6 @@ jobs:
env:
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}

- name: Set Git identity
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"

- name: Bump version with actions
run: |
git pull
Expand Down Expand Up @@ -167,10 +175,16 @@ jobs:
all_emails+="$email, "
done

all_commits=""
for commits in "${!authors_commits[@]}"; do
all_commits+="${authors_commits["$commits"]}"
done

# Trim the trailing comma and space
all_emails=${all_emails%, *}

echo -e "* $current_date $all_authors <$all_emails> - $VERSION" >> $changelog_file
echo -e "$all_commits" >> $changelog_file

spec_file=$(find . -type f -name "*.spec" | head -n 1)
changelog_section=$(awk '/%changelog/{p=1;next} p' $spec_file)
Expand Down Expand Up @@ -203,13 +217,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}

- name: Create tag
run: |
git fetch --all --tags
tag_name="${{ env.VERSION }}"
if ! git rev-parse -q --verify "refs/tags/$tag_name" >/dev/null; then
git tag $tag

- name: Release
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Overview

LogStatter is a high-performance monitoring application for logstash written in Rust. is designed to provide lightning-fast real-time process & pipeline anaylsis for Logstash, with output capabilities to Kafka.
LogStatter is a high-performance monitoring application for logstash written in Rust. is designed to provide lightning-fast real-time process & pipeline anaylsis for Logstash, with output capabilities to Kafka

## Getting Started

Expand Down
2 changes: 2 additions & 0 deletions build.date
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
14/12/2023 - 0.0.1
14/12/2023 - 0.0.2
29 changes: 14 additions & 15 deletions packaging/rpm/rb-logstatter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,49 @@ Version: %{__version}
Release: %{__release}%{?dist}
BuildArch: x86_64
Summary: Logstatter service to monitor logstash

License: AGPL-3.0
URL: https://github.com/malvads/logstatter
Source0: %{name}-%{version}.tar.gz

BuildRequires: gcc openssl-devel

BuildRequires: perl gcc openssl-devel
%global debug_package %{nil}

%description
%{summary}

%prep
%autosetup

%build
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env

cargo build --release

%install
install -D target/release/logstatter %{buildroot}/usr/bin/logstatter
install -D -m 0644 src/systemd/rb-logstatter.service %{buildroot}/usr/lib/systemd/system/rb-logstatter.service
install -D -m 0644 src/etc/logstatter.conf %{buildroot}/etc/logstatter/logstatter.conf

%pre
getent group logstatter >/dev/null || groupadd -r logstatter
getent passwd logstatter >/dev/null || useradd -r -g logstatter -d /var/lib/logstatter -s /sbin/nologin -c "RedBorder Logstatter User" logstatter

%post
systemctl daemon-reload
systemctl start rb-logstatter

%files
%defattr(0755,logstatter,logstatter)
/usr/bin/logstatter
%defattr(644,root,root)
/usr/lib/systemd/system/rb-logstatter.service
/etc/logstatter/logstatter.conf

%doc

%changelog
* Thu Dec 14 2023 Miguel Negron, Malvads, GitHub Actions <manegron@redborder.com, malvarez@redborder.com, actions@github.com> - 0.0.2
- Trigger workflow
- Update README
- Fix CI
- Delete chagelog tpm
- Fix CI
- Merge branch 'release/0.0.2' of github.com:redBorder/logstatter into release/0.0.2
- Add build dates
- Merge branch 'main' into release/0.0.2
- Fix auto bumping
- Update workflow
- Add auto bumping
- Bump version 0.0.2
* Mon Dec 11 2023 Miguel Álvarez <malvarez@redborder.com> - 0.0.1-1
- Initial package release