Skip to content

Commit

Permalink
Fix Github Action
Browse files Browse the repository at this point in the history
- Replace shell script with actions
- Fix macos/linux/windows binary builds
- Refactor Makefile to allow custom TARGET
- various project enhancement (README, Logo, support)
  • Loading branch information
yne committed Feb 13, 2022
1 parent 23ccd27 commit 87624c3
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 101 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: yne
1 change: 1 addition & 0 deletions .github/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/[email protected]
with: {style: Google}
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
cc: [ gcc, clang ]
needs: check
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- if: startswith(matrix.os, 'windows-')
run: make CC="${{matrix.cc}}" TARGET="vcd-${{matrix.os}}-${{matrix.cc}}.exe"
- if: startswith(matrix.os, 'windows-') == false
run: make CC="${{matrix.cc}}" TARGET="vcd-${{matrix.os}}-${{matrix.cc}}"
- uses: actions/upload-artifact@v2
with:
path: vcd-${{matrix.os}}-${{matrix.cc}}*
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- id: date
run: echo "::set-output name=yymmdd::$(date +%y%m%d)"
- uses: actions/checkout@v2
- uses: mathieudutour/[email protected]
with:
custom_tag: ${{ steps.date.outputs.yymmdd }}
tag_prefix: ''
github_token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true # tag exist
- uses: actions/download-artifact@v2
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.date.outputs.yymmdd }}
files: artifact/*
51 changes: 0 additions & 51 deletions .github/workflows/push.yml

This file was deleted.

47 changes: 6 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
#
# Makefile for vcd
#

TARGET=vcd

SRCS=vcd.c
DEPS=$(SRCS:.c=.dep)
OBJS=$(SRCS:.c=.o)

#
#
#

.PHONY: default
default: build

.PHONY: all
all: all

.PHONY: build
build: $(TARGET)

$(TARGET): $(OBJS)

$(OBJS): $(SRCS)

.PHONY: install
install: build
install -v -D vcd $(DESTDIR)/usr/bin/vcd

.PHONY: clean
clean:
$(RM) $(TARGET)
$(RM) $(OBJS)
$(RM) $(DEPS)


#
# EOF
#
TARGET?=vcd
SRCS:=$(wildcard *.c)
all: $(TARGET)
$(TARGET): $(SRCS); $(CC) $(CFLAGS) $(SRCS) -o $@
install: $(TARGET); install -v -D $< $(DESTDIR)/usr/bin/$<
clean: ; $(RM) $(TARGET)
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src=https://svgur.com/i/bp1.svg width=100% height=200>
<img src=.github/logo.svg width=100% height=200>

Value Change Dump (.vcd) command line viewer for Windows, Linux and MacOS

Expand Down Expand Up @@ -38,18 +38,25 @@ channels:
r_adr[1:0] : "1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 0 0 1 1 2 2 3 3 3 3 3 3 3 "
```
## Download
## Installation
See [releases page](../../releases)
### From prebuilt binary
## Build
Manually download install a [prebuilt binary](../../releases)
### From sources
```bash
make
sudo make install
```

### From Package Manager

Arch-based distribution:

```bash
cc vcd.c -o vcd
# classic style:
make && sudo make install
# custom limit:
cc vcd.c -o vcd -DMAX_SCOPE=32 -DMAX_CHANNEL=400 -DMAX_SAMPLE=2048
yay -S vcd
```

## Usage
Expand Down

0 comments on commit 87624c3

Please sign in to comment.