diff --git a/.github/workflows/copr.yml b/.github/workflows/copr.yml new file mode 100644 index 0000000..95ca1ee --- /dev/null +++ b/.github/workflows/copr.yml @@ -0,0 +1,37 @@ +name: Build rpm package and push to Fedora Copr + +on: + workflow_dispatch: + +jobs: + copr: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: 1.25 + + - name: Add rpm format to goreleaser config + run: echo " - rpm" >> .goreleaser.yaml + + - name: Build packages using goreleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + args: release --clean --skip=publish --skip=validate + + - name: Install copr cli + run: pip install copr-cli + + - name: Publish to Copr + env: + COPR_CONFIG: ${{ secrets.COPR_CONFIG }} + run: | + mkdir -p ~/.config + echo "$COPR_CONFIG" > ~/.config/copr + copr-cli build lazyjournal dist/*.rpm \ No newline at end of file diff --git a/.github/workflows/ppa.yml b/.github/workflows/ppa.yml index b8e5fcb..f33e0ec 100644 --- a/.github/workflows/ppa.yml +++ b/.github/workflows/ppa.yml @@ -1,4 +1,4 @@ -name: Build deb package and push to PPA +name: Build deb package and push to Ubuntu PPA on: workflow_dispatch: diff --git a/Supfile.yml b/Supfile.yml deleted file mode 100644 index 356a388..0000000 --- a/Supfile.yml +++ /dev/null @@ -1,131 +0,0 @@ -env: - GIT_URL: https://github.com/Lifailon/lazyjournal - -networks: - dev: - hosts: - - lifailon@192.168.3.101:2121 - bsd: - hosts: - - root@192.168.3.102:22 - - root@192.168.3.103:22 - rpi: - hosts: - - lifailon@192.168.3.105:2121 - - lifailon@192.168.3.106:2121 - -commands: - install: - desc: Install Go - run: | - if command -v go > /dev/null 2>&1; then - go version - else - if [ "$(uname -s)" = "FreeBSD" ]; then - pkg update - pkg install -y go - elif [ "$(uname -s)" = "OpenBSD" ]; then - pkg_add -u - yes | pkg_add go - fi - fi - - creat: - desc: Creat directory for upload files - run: | - rm -rf docker/lazyjournal - mkdir -p docker/lazyjournal - - copy: - desc: Upload all files to remote hosts - upload: - - src: \* - dst: docker/lazyjournal - - ls: - desc: Check directory - run: ls -lh docker/lazyjournal - - prep: - desc: Install dependencies and code preparation - run: | - cd docker/lazyjournal - go fmt ./... - go vet ./... - go get ./... - go mod tidy - go mod verify - go build -o /dev/null -v ./... - - test: - desc: Run unit tests - run: | - cd docker/lazyjournal - go test -v -cover --run "TestUnixFiles|TestColor|TestFilter|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface|TestMockInterface" - - docker: - desc: Run docker containers test - run: | - cd docker/lazyjournal - go test -v -cover --run "TestDockerContainer" - - remove: - desc: Remove files on remote hosts - run: | - rm -rf docker/lazyjournal - ls -l docker/lazyjournal 2> /dev/null || echo "lazyjournal removed" - - bin: - desc: Install binary from GitHub - run: curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh | bash - - flags: - desc: Check flags from release - run: | - if [ "$(uname -s)" = "FreeBSD" ]; then - . ~/.shrc - elif [ "$(uname -s)" = "OpenBSD" ]; then - . ~/.kshrc - fi - lazyjournal -v - mkdir -p /opt - echo test > /opt/test.log - lazyjournal -a - rm /opt/test.log - lazyjournal -g - curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -c - curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -f "success" - curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -r "http|127" - - tmux: - desc: Check run interface from release - run: | - if [ "$(uname -s)" = "FreeBSD" ]; then - . /root/.shrc - elif [ "$(uname -s)" = "OpenBSD" ]; then - . /root/.kshrc - fi - tmux new-session -d -s test-session lazyjournal - sleep 1 - tmux capture-pane -p - tmux send-keys -t test-session "$(echo -e 'syslog\t\r')" - sleep 2 - tmux capture-pane -p - tmux send-keys -t test-session "$(echo -e '\t\t\trsyslogd')" - sleep 2 - tmux capture-pane -p - tmux kill-session -t test-session - -targets: - testing: - - install - - creat - - copy - - ls - - prep - - test - - remove - release: - - bin - - flags - - tmux \ No newline at end of file