From bfeae9964028a0983ab7a1e7100614fa4c16ddaa Mon Sep 17 00:00:00 2001 From: Zine Moualhi <114167214+muandane@users.noreply.github.com> Date: Sun, 12 Nov 2023 19:55:59 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8=20(workflows):=20added=20go-re?= =?UTF-8?q?leaser=20(#66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat ✨ (workflows): added go-releaser * fix 🐛 (linting.yml): fixed indentation Signed-off-by: moualhi zine el abidine * docs 📚: added brew installation --------- Signed-off-by: moualhi zine el abidine --- .github/workflows/release.yml | 29 +++++++++++++++++++++ .github/workflows/tag-release.yml | 43 ------------------------------- .goreleaser.yml | 25 ++++++++++++++++++ README.md | 8 ++++++ contributors.yml | 3 ++- 5 files changed, 64 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/tag-release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..5ef83bc8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - "v*.*.*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.1' + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5.0.0 + with: + distribution: goreleaser + version: ${{ env.GITHUB_REF_NAME }} + args: release --clean + workdir: ./ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml deleted file mode 100644 index d7dff331..00000000 --- a/.github/workflows/tag-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*.*.*" - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.1' - - - name: Install dependencies - run: go mod tidy - - - name: Install dependencies - run: go mod download - - - name: Build - run: | - env GOOS=linux GOARCH=amd64 go build -o bin/go-blueprint-Linux_x86_64 main.go - env GOOS=linux GOARCH=arm64 go build -o bin/go-blueprint-Linux_arm64 main.go - env GOOS=darwin GOARCH=amd64 go build -o bin/go-blueprint-Darwin_amd64 main.go - env GOOS=darwin GOARCH=arm64 go build -o bin/go-blueprint-Darwin_arm64 main.go - env GOOS=windows GOARCH=amd64 go build -o bin/go-blueprint-Windows_amd64.exe main.go - - - name: Create release - id: release - uses: softprops/action-gh-release@v1 - with: - files: | - ./bin/* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..66a1dede --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,25 @@ +builds: +- binary: go-blueprint + main: ./ + goos: + - darwin + - linux + - windows + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + +release: + prerelease: auto + +universal_binaries: +- replace: true + +brews: +- name: go-blueprint + homepage: "https://github.com/Melkeydev/homebrew-melkey" + +checksum: + name_template: 'checksums.txt' diff --git a/README.md b/README.md index 70726b95..c54264e2 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,15 @@ gives the option to integrate with one of the more popular Go frameworks (and th ### Install +- **Brew install :** + +```sh +brew install go-blueprint ``` + +- **Go install :** + +```sh go install github.com/melkeydev/go-blueprint@latest ``` diff --git a/contributors.yml b/contributors.yml index e09ebab6..9e6ff4fc 100644 --- a/contributors.yml +++ b/contributors.yml @@ -8,4 +8,5 @@ - young-steveo - mikelerch - nhlmg93 -- sakelig \ No newline at end of file +- sakelig +- muandane