Skip to content

Commit

Permalink
chore: add goreleaser support
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMenoti committed Oct 10, 2022
1 parent 10f5381 commit 9f19767
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,18 @@ jobs:
--exclude "*" --include "azioncli*" \
dist/$distro/$arch/ s3://azion-downloads/$distro/$arch/; \
done < BUILD
- name: set bin_version environment variable
run: echo "BIN_VERSION=$(git describe --tags)" >> $GITHUB_ENV


- uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_URL: https://api.azionapi.net
AUTH_URL: https://sso.azion.com/api/user/me
55 changes: 55 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
builds:
- env:
- CGO_ENABLED=0
binary: azioncli
main: ./cmd/azioncli
ldflags:
- -X github.com/aziontech/azion-cli/pkg/cmd/version.BinVersion={{ .Env.BIN_VERSION }}
- -X github.com/aziontech/azion-cli/pkg/constants.AuthURL={{ .Env.AUTH_URL }}
- -X github.com/aziontech/azion-cli/pkg/constants.ApiURL={{ .Env.API_URL }}
goos:
- linux
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
amd64: x86_64

brews:
- name: azioncli
homepage: https://github.com/aziontech/azion-cli
description: The developer friendly way to interact with Azion
license: "MIT"
dependencies:
- name: git
- name: jq
tap:
owner: aziontech
name: homebrew-tap

nfpms:
- id: packages
license: MIT
package_name: azioncli
maintainer: aziontech
homepage: https://github.com/aziontech/azion-cli
bindir: /usr/local/bin
builds:
- azioncli
formats:
- apk
- deb
- rpm

checksum:
name_template: "{{ .ProjectName }}_v{{ .Env.BIN_VERSION }}_checksum"
snapshot:
name_template: "{{ incpatch .Env.BIN_VERSION }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The Azion CLI (command-line interface) is an open source tool that enables you t
The developer friendly way to interact with Azion!

## Quick links
* [Downloading] (#downloading)
* [Building](#building)
* [How to Use](#How-to-Use)
* [Commands Reference](https://github.com/aziontech/azion-cli/wiki/azioncli)
Expand All @@ -17,6 +18,18 @@ The developer friendly way to interact with Azion!
* [License](#License)


## Downloading

There are two ways to download and use `azioncli`
The first, is the regular way of cloning this repository and [building] (#building) the project manually.
However, `azioncli` is also available as `homebrew`, `rpm`, `deb` and `apk` packages.

To use `rpm`, `deb` and `apk` packages, please visit our [releases] (https://github.com/aziontech/azion-cli/releases) page, and download the desired package.

To download azioncli through Homebrew, use the following:
* `brew install aziontech/tap/azioncli`


## Building

```sh
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/webapp/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ func newCobraCmd(init *initCmd) *cobra.Command {
SilenceErrors: true,
Example: heredoc.Doc(`
$ azioncli init --help
$ azioncli init --name "thisisatest" --type javascript
$ azioncli init --name "thisisatest" --type flareact
$ azioncli init --name "thisisatest" --type nextjs
$ azioncli webapp init --name "thisisatest" --type javascript
$ azioncli webapp init --name "thisisatest" --type flareact
$ azioncli webapp init --name "thisisatest" --type nextjs
`),
RunE: func(cmd *cobra.Command, args []string) error {
return init.run(info, options)
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/webapp/publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func newCobraCmd(publish *publishCmd) *cobra.Command {
SilenceErrors: true,
Example: heredoc.Doc(`
$ azioncli webapp publish --help
$ azioncli webapp publish --yes
`),
RunE: func(cmd *cobra.Command, args []string) error {
return publish.run(publish.f, options)
Expand Down
1 change: 0 additions & 1 deletion utils/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "errors"
var (
//Generic errors that can be used by any package
GenericUseHelp = errors.New("Use -h or --help for more information")
ErrorConvertingIdArgumentToInt = errors.New("You must provide a valid id")
ErrorConvertingStringToBool = errors.New("You must provide a valid value. Use -h or --help for more information")
ErrorHandlingFile = errors.New("You must provide a valid file name. Use -h or --help for more information")
ErrorEmptyFile = errors.New("Content file may not be empty")
Expand Down

0 comments on commit 9f19767

Please sign in to comment.