diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 43bb558..5269aec 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,6 +41,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + fetch-depth: 0 ref: ${{ needs.release-please.outputs.release_tag_name }} - name: Set up Go @@ -48,14 +49,11 @@ jobs: with: go-version-file: 'go.mod' - - name: Build - run: go build -o openfeature ./src - - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 with: - upload_url: ${{ needs.release-please.outputs.upload_url }} - asset_path: ./openfeature - asset_name: openfeature - asset_content_type: application/octet-stream + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + # 'latest', 'nightly', or a semver + version: "~> v2" + args: release --clean \ No newline at end of file diff --git a/.gitignore b/.gitignore index 64ae7f3..e49de67 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ go.work go.work.sum # env file -.env \ No newline at end of file +.env +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..c30130a --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,40 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 +project_name: openfeature + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +report_sizes: true