diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml new file mode 100644 index 0000000..1cd4589 --- /dev/null +++ b/.github/workflows/commit.yml @@ -0,0 +1,22 @@ +name: Go + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.19 + + - name: Build + run: go build -v + + - uses: actions/upload-artifact@v3 + with: + name: alaconf + path: alaconf \ No newline at end of file diff --git a/.github/workflows/ontag_release.yml b/.github/workflows/ontag_release.yml new file mode 100644 index 0000000..96fb705 --- /dev/null +++ b/.github/workflows/ontag_release.yml @@ -0,0 +1,41 @@ + +on: + push: + tags: + - 'v*' + +name: Create release +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Release ${{ github.ref }} + uses: softprops/action-gh-release@v1 + with: + files: | + LICENSE + README.md + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/amd64, linux/arm64, windows/amd64, darwin/amd64, darwin/arm64 + # comment Windows for now, as the program is not yet compatible with it yet + # goos: [linux, windows, darwin] + goos: [linux, darwin] + goarch: [amd64, arm64] + # exclude: + # - goarch: arm64 + # goos: windows + steps: + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.32 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + project_path: "./" + binary_name: "alaconf" + extra_files: LICENSE README.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1549dce..ea925a1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,4 @@ .vscode .DS_Store -alaconf **/*.code-workspace diff --git a/main.go b/main.go new file mode 100644 index 0000000..e5bbc1a --- /dev/null +++ b/main.go @@ -0,0 +1,25 @@ +package main + +import ( + "flag" + "fmt" + + "github.com/jjournet/alaconf/pkg/alacritty" +) + +var ( + color = flag.String("color", "", "color theme to use") + getcolor = flag.Bool("getcolor", false, "get current color theme") +) + +func main() { + flag.Parse() + + myconf := alacritty.NewConfig("") + if *getcolor { + fmt.Println(alacritty.GetColorTheme(&myconf)) + } else if *color != "" { + alacritty.ChangeColorTheme(&myconf, *color) + alacritty.SaveConfig(&myconf) + } +}