Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.cirrus.yml: add release tasks using GoReleaser #19

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,33 @@ task:
name: Test

script: go test -v ./...

task:
name: Release (Dry Run)
only_if: $CIRRUS_TAG == ''
depends_on:
- Lint
- Test
install_script:
- echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
- apt-get update
- apt-get -y install goreleaser-pro
release_script: goreleaser build --snapshot
goreleaser_artifacts:
path: "dist/**"

task:
name: Release
only_if: $CIRRUS_TAG != ''
depends_on:
- Lint
- Test
env:
GITHUB_TOKEN: ENCRYPTED[!98ace8259c6024da912c14d5a3c5c6aac186890a8d4819fad78f3e0c41a4e0cd3a2537dd6e91493952fb056fa434be7c!]
FURY_TOKEN: ENCRYPTED[!97fe4497d9aca60a3d64904883b81e21f19706c6aedda625c97f62f67ec46b8efa74c55699956158bbf0a23726e7d9f6!]
GORELEASER_KEY: ENCRYPTED[!9b80b6ef684ceaf40edd4c7af93014ee156c8aba7e6e5795f41c482729887b5c31f36b651491d790f1f668670888d9fd!]
install_script:
- echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
- apt-get update
- apt-get -y install goreleaser-pro
release_script: goreleaser
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# cloud-init image
/tools/cloud-init/cloud-init.iso

# GoReleaser
/dist
42 changes: 42 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
project_name: vetu

before:
hooks:
- go mod download

builds:
- main: cmd/vetu/main.go
ldflags: >
-X github.com/cirruslabs/vetu/internal/version.Version={{.Version}}
-X github.com/cirruslabs/vetu/internal/version.Commit={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64

archives:
- id: binary
format: binary
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
- id: regular
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"

release:
prerelease: auto

nfpms:
- package_name: vetu
vendor: Cirrus Labs, Inc.
homepage: https://github.com/cirruslabs/vetu
maintainer: [email protected]
description: CLI for executing Cirrus tasks locally and in any CI
section: misc
formats:
- deb
- rpm

furies:
- account: cirruslabs