Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat: add new release commands to manage GitLab releases #445

Merged
merged 15 commits into from
May 27, 2021
Prev Previous commit
Next Next commit
feat: add release create command
  • Loading branch information
profclems committed May 22, 2021
commit d5d5d9736298e12c474cfcba2da7cdffb5752050
31 changes: 0 additions & 31 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ workflow:
- if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable$/'
#

stages:
- test

default:
image: golang:1.15

Expand All @@ -40,31 +37,3 @@ code_navigation:
artifacts:
reports:
lsif: dump.lsif

.test:
variables:
GOPATH: "/builds/go"
GIT_CLONE_PATH: $GOPATH/src/github.com/profclems/glab
GITLAB_TOKEN: "qRC87Xg9Wd46RhB8J8sp"
CODECOV_TOKEN: "1597edbc-8760-42c1-ab79-c192ad151717"
before_script:
# Add a non-sensitive ssh key for test to work.
- mkdir ~/.ssh && chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCc54ULcDSmuQBMaM52dqxNMETAlwn01AF79vJb6Nw3SzkNKEMY1pBttM1U8wz7dHpVteAQGCU2AH+T2UhswZWPIzcMfVwB+1RgcIkHW184V5FX1xxqo4Xx6CC6LTSq3md/EmXfQR7gAwaKQHy6txxYpEprlhw+EWICgD5znUMprRRbcsb2FoAdsodMWSl5aRIyC1rA06SKKwqN09o4mgNhv49McyzDnUCGmSTc0oQpygPadDRqW46iCkMdiJa1fuP9pSGkAuTaQayILbDenAM3cV7LqsIm7tOXLPW5fQm9FB91ftRLXxk1Mp6lMYqNc5eGoR4ATzHn7M/VHbBaqVlp profclems@ProfClems" > ~/.ssh/id_rsa.pub
- echo -e "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAA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RIJNm2/\n4htjlAxdz2Zxa8JL437s56Jf4ZtDOYt367dhTMRBleoxAAAAgDo0de+4nNSVb/H3aGo5Y0\nLg/q/npYUNVSvZ9R0GfRY0qDbNCaKeqbyJDkReRn5R/KKT9+Gx0/zqXGNi1ubnGtxqCCmC\nYHDys0PSw6yAEDZ3JOeYWEIO7ntH0DKdErcEUj+FqatdIpoZZO48XZDSXzO1+B1n2y+AML\nfyMggdFXIBAAAAgQDMnIFss9kLpnqC5QOAiDO+jsnHwNHENBgQKE9/jM6gagaK3T4TDkJl\nPszXRDE11LSBCxahL5rxwWDog1vG67tnbfznjhGm8Fd+mEs6omuQ5pA0o6Qx40xtkfn3vi\nj4NLkpo5rYg0DTtciDgGeibtt1oT1EhKZ59ystGdFgSGWxtQAAAIEAxE+xPCLHzqEUUlxI\nSJC6+e2hUT/9s64OwmH9pCrQ8+96G9TtbR9NFD1LSArnLXvl6ooYODw0QDjLdgCUQj63r7\nqOV9QjWKL6xD1atN37WFbrIpem8pFOJWinYrQtddANSBd5tp5QsDkI58ovqhdDuYoVfL1y\nmEfWvucOVlZraWUAAAATcHJvZmNsZW1zQFByb2ZDbGVtcw==\n-----END OPENSSH PRIVATE KEY-----" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa*
- eval `ssh-agent -s`
- ssh-add ~/.ssh/id_rsa
script:
- go version
- export PATH=$GOPATH/bin:$PATH
- go get -t -v ./...
- make test
after_script:
- bash <(curl -s https://codecov.io/bash)

test:
stage: test
extends: .test
image: golang:1.15
15 changes: 10 additions & 5 deletions commands/release/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,20 @@ You need push access to the repository to create a Release.`,
}

if opts.NotesFile != "" {
var b []byte
var err error
if opts.NotesFile == "-" {
b, err := ioutil.ReadAll(opts.IO.In)
b, err = ioutil.ReadAll(opts.IO.In)
_ = opts.IO.In.Close()
if err != nil {
return err
}
} else {
b, err = ioutil.ReadFile(opts.NotesFile)
}

opts.Notes = string(b)
if err != nil {
return err
}

opts.Notes = string(b)
}

if runE != nil {
Expand Down