Skip to content

Commit

Permalink
Merge pull request #1281 from iawia002/goreleaser
Browse files Browse the repository at this point in the history
Add goreleaser action
  • Loading branch information
iawia002 authored Oct 9, 2023
2 parents 2456ad9 + e71df48 commit e517c7e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: goreleaser
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-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.21
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
21 changes: 3 additions & 18 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
project_name: lux
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
binary: lux
- binary: lux
ldflags: -s -w -X github.com/iawia002/lux/app.version={{ .RawVersion }}
goos:
- windows
- darwin
Expand All @@ -29,17 +29,6 @@ builds:
- goos: openbsd
goarch: arm
goarm: 6
env_files:
github_token: ./github_token
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs'
- '^tests'
- Merge pull request
- Merge branch
archives:
- name_template: >-
{{ .ProjectName }}_
Expand All @@ -56,7 +45,3 @@ archives:
files:
- none*
wrap_in_directory: false
release:
draft: true
footer: |
**Full Changelog**: https://github.com/iawia002/lux/compare/{{ .PreviousTag }}...{{ .Tag }}
10 changes: 5 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/iawia002/lux/utils"
)

const (
// Name is the name of this app.
Name = "lux"
version = "v0.20.0"
)
// Name is the name of this app.
const Name = "lux"

// This value will be injected into the corresponding git tag value at build time using `-ldflags`.
var version = "v0.0.0"

func init() {
cli.VersionPrinter = func(c *cli.Context) {
Expand Down

0 comments on commit e517c7e

Please sign in to comment.