-
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.
- Loading branch information
kaka
committed
Apr 21, 2024
1 parent
8ad5ddf
commit cd9b57a
Showing
7 changed files
with
675 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,42 @@ | ||
name: Build & Release | ||
on: | ||
release: | ||
types: [created] | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
build-n-release: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# build and publish in parallel: linux/amd64, linux/arm64, windows/amd64, darwin/amd64, darwin/arm64 | ||
goos: [linux, windows, darwin] | ||
goarch: [amd64, arm64] | ||
exclude: | ||
- goarch: arm64 | ||
goos: windows | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '>=1.22' | ||
|
||
- name: Set APP_VERSION env | ||
run: echo APP_VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV} | ||
- name: Set BUILD_TIME env | ||
run: echo BUILD_TIME=$(date --iso-8601=seconds) >> ${GITHUB_ENV} | ||
- name: Environment Printer | ||
uses: managedkaos/print-env@v1.0 | ||
|
||
- uses: wangyoucao577/go-release-action@v1 | ||
with: | ||
pre_command: export CGO_ENABLED=0 | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
ldflags: -X "main.buildTime=${{ env.BUILD_TIME }}" -X "main.commitHash=${{ github.sha }}" -X "main.version=${{ env.APP_VERSION }}" |
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,47 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# MS VSCode | ||
.vscode | ||
__debug_bin | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
*.core | ||
|
||
*.db | ||
*.log | ||
*.log.*.gz | ||
|
||
/debug | ||
/bin | ||
/.venv | ||
/yarn.lock | ||
/yarn-error.log | ||
/VERSION | ||
|
||
# Manpage | ||
/man | ||
|
||
/pkg | ||
|
||
./cyberark | ||
./cyberpass | ||
./host* | ||
./inventory* | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
# cyberpass | ||
# Get passwords from cyberark at once. |
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,13 @@ | ||
#!/bin/bash | ||
|
||
#buildTime=$(date --rfc-3339=seconds) | ||
buildTime=$(date) | ||
commitHash=$(git rev-parse HEAD) | ||
version="${1:-manual build}" | ||
|
||
# static binary | ||
export CGO_ENABLED=0 | ||
|
||
# go mod init cyberpass | ||
# go mod tidy | ||
go build -ldflags ' -X "main.buildTime='"$buildTime"'" -X "main.commitHash='"${commitHash^^}"'" -X "main.version='"${version^^}"'" ' |
Oops, something went wrong.