-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
alaconf as main package and CI/CD for github
- Loading branch information
Jean-Pascal Journet
committed
Nov 4, 2022
1 parent
8121201
commit 0edc8d9
Showing
4 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,4 @@ | |
|
||
.vscode | ||
.DS_Store | ||
alaconf | ||
**/*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |