Skip to content

Commit

Permalink
alaconf as main package and CI/CD for github
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Pascal Journet committed Nov 4, 2022
1 parent 8121201 commit 0edc8d9
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions .github/workflows/ontag_release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./"
binary_name: "alaconf"
extra_files: LICENSE README.md
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@

.vscode
.DS_Store
alaconf
**/*.code-workspace
25 changes: 25 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 0edc8d9

Please sign in to comment.