From 0c8915c216cd422f44e83bf59ec35a6bbad46a10 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Fri, 21 Jun 2024 21:45:49 +0200 Subject: [PATCH] goreleaser --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 10 +++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6e100a0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5.0.1 + with: + go-version: "1.22" + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..93d20e8 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,10 @@ +builds: + - main: ./cmd/maprenderer + env: + - CGO_ENABLED=1 + targets: + - linux_amd64 + ldflags: + - -s -w -extldflags=-static +changelog: + sort: asc