Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
d291489247 | |||
30c65042dd |
@ -9,6 +9,7 @@ env:
|
|||||||
BINARY_NAME: git-project-manager
|
BINARY_NAME: git-project-manager
|
||||||
GO_MOD_PATH: gitea.libretechconsulting.com/rmcguire/git-project-manager
|
GO_MOD_PATH: gitea.libretechconsulting.com/rmcguire/git-project-manager
|
||||||
GO_GIT_HOST: gitea.libretechconsulting.com
|
GO_GIT_HOST: gitea.libretechconsulting.com
|
||||||
|
PLATFORMS: linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@ -27,20 +28,25 @@ jobs:
|
|||||||
VERSION: ${{ github.ref_name }}
|
VERSION: ${{ github.ref_name }}
|
||||||
run: make all
|
run: make all
|
||||||
|
|
||||||
- name: Upload Binary to Generic Registry
|
- name: Upload Binaries to Generic Registry
|
||||||
env:
|
env:
|
||||||
API_TOKEN: ${{ secrets.API_TOKEN }}
|
API_TOKEN: ${{ secrets.API_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "Pushing ./$BINARY_PATH/$BINARY_NAME to ${GITHUB_SERVER_URL} packages for ${GITHUB_REPOSITORY_OWNER} as ${PACKAGE_NAME}@${{ github.ref_name }}"
|
for platform in $PLATFORMS; do
|
||||||
if [ -f ./${BINARY_PATH}/${BINARY_NAME} ]; then
|
OS=$(echo $platform | cut -d/ -f1)
|
||||||
curl -X PUT \
|
ARCH=$(echo $platform | cut -d/ -f2)
|
||||||
-H "Authorization: token ${API_TOKEN}" \
|
BINARY_FILE="${BINARY_PATH}/${PACKAGE_NAME}-${OS}-${ARCH}"
|
||||||
--upload-file ./${BINARY_PATH}/${BINARY_NAME} \
|
echo "Uploading $BINARY_FILE"
|
||||||
"${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}/${{ github.ref_name }}/${BINARY_NAME}"
|
if [ -f "$BINARY_FILE" ]; then
|
||||||
else
|
curl -X PUT \
|
||||||
echo "Error: Binary ./${BINARY_PATH}/${BINARY_NAME} not found."
|
-H "Authorization: token ${API_TOKEN}" \
|
||||||
exit 1
|
--upload-file "$BINARY_FILE" \
|
||||||
fi
|
"${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}/${{ github.ref_name }}/${PACKAGE_NAME}-${OS}-${ARCH}"
|
||||||
|
else
|
||||||
|
echo "Error: Binary $BINARY_FILE not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Generate and Upload Package to Go Registry
|
- name: Generate and Upload Package to Go Registry
|
||||||
env:
|
env:
|
||||||
|
15
Makefile
15
Makefile
@ -3,6 +3,9 @@ CMD_NAME := git-project-manager
|
|||||||
.PHONY: all test build install docs clean
|
.PHONY: all test build install docs clean
|
||||||
|
|
||||||
VERSION ?= development # Default to "development" if VERSION is not set
|
VERSION ?= development # Default to "development" if VERSION is not set
|
||||||
|
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
|
||||||
|
OUTPUT_DIR := bin
|
||||||
|
PKG := gitea.libretechconsulting.com/rmcguire/git-project-manager
|
||||||
|
|
||||||
all: test build install docs
|
all: test build install docs
|
||||||
|
|
||||||
@ -10,10 +13,18 @@ test:
|
|||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|
||||||
build: test
|
build: test
|
||||||
go build -ldflags "-X gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd.Version=$(VERSION)" -o bin/${CMD_NAME}
|
@echo "Building for platforms: $(PLATFORMS)"
|
||||||
|
@for platform in $(PLATFORMS); do \
|
||||||
|
OS=$$(echo $$platform | cut -d/ -f1); \
|
||||||
|
ARCH=$$(echo $$platform | cut -d/ -f2); \
|
||||||
|
OUTPUT="$(OUTPUT_DIR)/$(CMD_NAME)-$$OS-$$ARCH"; \
|
||||||
|
GOOS=$$OS GOARCH=$$ARCH go build -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" -o $$OUTPUT; \
|
||||||
|
echo "Built $$OUTPUT"; \
|
||||||
|
done
|
||||||
|
go build -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" -o bin/${CMD_NAME}
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -v -ldflags "-X gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd.Version=$(VERSION)" .
|
go install -v -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" .
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
bin/${CMD_NAME} docs md
|
bin/${CMD_NAME} docs md
|
||||||
|
39
README.md
39
README.md
@ -8,6 +8,36 @@ and shortcuts.
|
|||||||
|
|
||||||
This supports GitHub, GitLab, and Gitea remotes.
|
This supports GitHub, GitLab, and Gitea remotes.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Install git-project-manager using `go`:
|
||||||
|
`go install -v gitea.libretechconsulting.com/rmcguire/git-project-manager@latest`
|
||||||
|
|
||||||
|
OR Download a pre-built binary:
|
||||||
|
[https://gitea.libretechconsulting.com/rmcguire/-/packages/generic/git-project-manager](https://gitea.libretechconsulting.com/rmcguire/-/packages/generic/git-project-manager)
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
**Generate a new config file:**
|
||||||
|
`git-project-manager config generate --write`
|
||||||
|
|
||||||
|
**For handy aliases and shell helpers:**
|
||||||
|
- Download `https://gitea.libretechconsulting.com/rmcguire/git-project-manager/raw/branch/main/contrib/gpm_func_omz.zsh`
|
||||||
|
- Implement however you like (e.g. copy to ~/.oh-my-zsh/custom/)
|
||||||
|
|
||||||
|
For just completion only, source completions from git-project-manager (e.g. for zsh, `source <(git-project-manager completion zsh)`)
|
||||||
|
|
||||||
|
_The following commands assume you've loaded the gpm alias and help funcs._
|
||||||
|
|
||||||
|
**Index your git repos**
|
||||||
|
`gpm cache load`
|
||||||
|
|
||||||
|
**Add your first project**
|
||||||
|
`padd` (gpm project add)
|
||||||
|
|
||||||
|
**Go to your project, fuzzily**
|
||||||
|
`pgo`
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
[Full documentation is available in docs/](./docs/git-project-manager.md)
|
[Full documentation is available in docs/](./docs/git-project-manager.md)
|
||||||
@ -40,15 +70,6 @@ The basic workflow looks like this:
|
|||||||
1. **List** -- get a list of your configured projects any time with `plist`
|
1. **List** -- get a list of your configured projects any time with `plist`
|
||||||
1. **Reward** -- buy the author a beer, because this thing is a time saver
|
1. **Reward** -- buy the author a beer, because this thing is a time saver
|
||||||
|
|
||||||
## Installing
|
|
||||||
|
|
||||||
1. Install into your go path by running `go install .`
|
|
||||||
1. Copy `contrib/gpm_func_omz.zsh` into your `~/.oh-my-zsh/custom/` path, or just source from your bashrc/zshrc
|
|
||||||
1. Generate config file: `gpm config gen --write`
|
|
||||||
1. You can run this any time to update settings
|
|
||||||
1. It will only add one Git remote, so update the file for multiple
|
|
||||||
1. Run `gpm cache load` (if aliases is in-place, otherwise `git-project-manager cache load`)
|
|
||||||
|
|
||||||
### Config Sample
|
### Config Sample
|
||||||
```yaml
|
```yaml
|
||||||
remotes:
|
remotes:
|
||||||
|
Reference in New Issue
Block a user