Skip to content

Commit

Permalink
migration initial
Browse files Browse the repository at this point in the history
  • Loading branch information
kaka committed Apr 21, 2024
1 parent 8ad5ddf commit cd9b57a
Show file tree
Hide file tree
Showing 7 changed files with 675 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
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 }}"
47 changes: 47 additions & 0 deletions .gitignore
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*

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# cyberpass
# Get passwords from cyberark at once.
13 changes: 13 additions & 0 deletions build.sh
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^^}"'" '
Loading

0 comments on commit cd9b57a

Please sign in to comment.