diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 64a897d..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build - -on: [workflow_dispatch] - -jobs: - build_cli: - name: Build CLI - runs-on: ${{matrix.os}} - strategy: - matrix: - os: [ubuntu-20.04, windows-2022, macos-12] - arch: [amd64] - - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - cache: true - - - name: Update Go modules - run: go mod download -json - - - name: Build CLI - run: go build -trimpath -o ./bin/cpm$(go env GOEXE) - env: - GOARCH: ${{ matrix.arch }} - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: cpm-${{ matrix.os }}-${{ matrix.arch }} - path: ./bin/cpm* - if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7bfb3fd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.4' + cache: true + - uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GH_HOMEBREW_TAP }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..10a911b --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,82 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +project_name: cpm +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 +archives: + - format: binary +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +nfpms: + - + package_name: cpm + vendor: COZ Inc. + homepage: https://github.com/CityOfZion/ + maintainer: COZ + description: |- + NEO Contract Package Manager + license: MIT + formats: + - apk + - deb + - rpm + - archlinux +#chocolateys: +# - +# project_url: https://github.com/CityOfZion/cpm +# copyright: 2022 COZ Inc +# license_url: https://github.com/CityOfZion/cpm/blob/master/LICENSE +# require_license_acceptance: false +# project_source_url: https://github.com/CityOfZion/cpm +# docs_url: https://github.com/CityOfZion/cpm/blob/main/README.md +# bug_tracker_url: https://github.com/CityOfZion/cpm/issues +# summary: NEO Blockchain Contract Package Manager +# +# description: | +# {{ .ProjectName }} installer package. +# Download selected contracts from a chain to your local chain for development purposes. +# Generate SDKs for selected contracts to work with. +# +# api_key: '{{ .Env.CHOCOLATEY_API_KEY }}' +# source_repo: "https://push.chocolatey.org/" +# +# # Setting this will prevent goreleaser to actually try to push the package +# # to chocolatey repository, leaving the responsability of publishing it to +# # the user. +# skip_publish: false + +# Github release +release: + draft: true + replace_existing_draft: true + +# OSX homebrew tap +brews: + - + tap: + owner: CityOfZion + name: homebrew-tap + homepage: https://github.com/CityOfZion/cpm + description: NEO Blockchain Contract Package Manager + skip_upload: false \ No newline at end of file diff --git a/README.md b/README.md index 8de538b..f6d0947 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Installation -Download the tool from the releases page and place it somewhere on your path +Download the binary from the releases page and place it somewhere on your path, or + +## OSX +```shell +brew install CityOfZion/tap/cpm +``` # Usage diff --git a/go.mod b/go.mod index 3a05054..26b14fb 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module cpm go 1.18 require ( + github.com/iancoleman/strcase v0.2.0 github.com/nspcc-dev/neo-go v0.99.2 github.com/sirupsen/logrus v1.9.0 github.com/urfave/cli/v2 v2.11.1 @@ -15,7 +16,6 @@ require ( github.com/google/uuid v1.2.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 // indirect github.com/nspcc-dev/rfc6979 v0.2.0 // indirect