diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b07521..57601a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,76 +1,35 @@ on: push: - # run only against tags tags: - '*' jobs: - linux: - runs-on: ubuntu-latest + release: + strategy: + matrix: + include: + - os: ubuntu-latest + config: '.goreleaser.linux.yml' + - os: macos-latest + config: '.goreleaser.darwin.yml' + - os: windows-latest + config: '.goreleaser.windows.yml' + runs-on: ${{ matrix.os }} steps: - - - name: Checkout + - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22.0' - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - if: startsWith(github.ref, 'refs/tags/') - with: - version: latest - args: release --clean --config .goreleaser.yml --id linux - env: - GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }} - mac: - runs-on: macos-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.22.0' - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - if: startsWith(github.ref, 'refs/tags/') - with: - version: latest - args: release --clean --config .goreleaser.yml --id darwin - env: - GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }} - - windows: - runs-on: windows-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22.0' - - - name: Run GoReleaser + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v4 - if: startsWith(github.ref, 'refs/tags/') with: version: latest - args: release --clean --config .goreleaser.yml --id windows + args: release --config ${{ matrix.config }} env: - GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.darwin.yml b/.goreleaser.darwin.yml new file mode 100644 index 0000000..5124a7b --- /dev/null +++ b/.goreleaser.darwin.yml @@ -0,0 +1,43 @@ +release: + # Repo in which the release will be created. + github: + owner: taubyte + name: dreamland + + # Control the draft and prerelease settings + draft: false + replace_existing_draft: false + prerelease: auto + + # Release naming and SCM interaction + name_template: "" + disable: false + skip_upload: false + +builds: + - id: "darwin" + main: "main.go" + binary: "dreamland" + goos: + - darwin + goarch: + - arm64 + - amd64 + env: + - CGO_ENABLED=1 + flags: + - -trimpath + tags: + - darwin + - odo + + +changelog: + skip: true + +checksum: + disable: true + +archives: + - files: + - none* diff --git a/.goreleaser.linux.yml b/.goreleaser.linux.yml new file mode 100644 index 0000000..07be2ca --- /dev/null +++ b/.goreleaser.linux.yml @@ -0,0 +1,39 @@ +release: + # Repo in which the release will be created. + github: + owner: taubyte + name: dreamland + + # Control the draft and prerelease settings + draft: false + replace_existing_draft: false + prerelease: auto + + # Release naming and SCM interaction + name_template: "" + disable: false + skip_upload: false + +builds: + - id: "linux" + main: "main.go" + binary: "dreamland" + goos: + - linux + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + - GOAMD64=v2 + + +changelog: + skip: true + +checksum: + disable: true + +archives: + - files: + - none* diff --git a/.goreleaser.windows.yml b/.goreleaser.windows.yml new file mode 100644 index 0000000..b4bfd45 --- /dev/null +++ b/.goreleaser.windows.yml @@ -0,0 +1,40 @@ +release: + # Repo in which the release will be created. + github: + owner: taubyte + name: dreamland + + # Control the draft and prerelease settings + draft: false + replace_existing_draft: false + prerelease: auto + + # Release naming and SCM interaction + name_template: "" + disable: false + skip_upload: false + +builds: + - id: "windows" + main: "main.go" + binary: "dreamland.exe" + goos: + - windows + goarch: + - amd64 + env: + - CGO_ENABLED=0 + - GOAMD64=v2 + tags: + - windows + + +changelog: + skip: true + +checksum: + disable: true + +archives: + - files: + - none* diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 78174e5..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,100 +0,0 @@ -# .goreleaser.yaml -release: - # Repo in which the release will be created. - # Default is extracted from the origin remote URL or empty if its private hosted. - github: - owner: taubyte - name: dreamland - - # If set to true, will not auto-publish the release. - # Available only for GitHub and Gitea. - # - # Default is false. - draft: false - - # Whether to remove existing draft releases with the same name before creating - # a new one. - # Only effective if `draft` is set to true. - # Available only for GitHub. - # - # Default: false. - # Since: v1.11. - replace_existing_draft: false - - # If set to auto, will mark the release as not ready for production - # in case there is an indicator for this in the tag e.g. v1.0.0-rc1 - # If set to true, will mark the release as not ready for production. - # Default is false. - prerelease: auto - - # You can change the name of the release. - # Default is `{{.Tag}}` on OSS and `{{.PrefixedTag}}` on Pro. - name_template: "" - - # You can disable this pipe in order to not create the release on any SCM. - # Keep in mind that this might also break things that depend on the release - # URL, for instance, homebrew taps. - # - # Defaults to false. - # Templateable since: v1.15. - disable: false - - # Set this to true if you want to disable just the artifact upload to the SCM. - # If this is true, GoReleaser will still create the release with the - # changelog, but won't upload anything to it. - # - # Default: false. - # Since: v1.11. - # Templateable since: v1.15. - skip_upload: false - -builds: - - main: "main.go" - id: linux - binary: "dreamland" - goos: - - linux - goarch: - - amd64 - - arm64 - env: - - CGO_ENABLED=0 - - GOAMD64=v2 - - main: "main.go" - id: darwin - binary: "dreamland" - goos: - - darwin - goarch: - - arm64 - - amd64 - env: - - CGO_ENABLED=1 - flags: - - -trimpath - tags: - - darwin - - odo - - main: "main.go" - id: windows - binary: "dreamland" - goos: - - windows - goarch: - - amd64 - env: - - CGO_ENABLED=0 - - GOAMD64=v2 - tags: - - windows - -changelog: - skip: true - -checksum: - disable: true - -# Archives files to attach: https://goreleaser.com/customization/archive/?h=readme -archives: -- files: - - none* \ No newline at end of file