Skip to content
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
38 changes: 0 additions & 38 deletions .github/workflows/bump-version.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version number (x.x.x)'
required: true
type: string

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod

- name: Setup Git
run: |
git config user.name 'GitHub Actions'
git config user.email 'actions@github.com'

- name: Create and push tag
run: |
VERSION="${{ inputs.version }}"
git tag -a "v${VERSION}" -m "Release version ${VERSION}"
git push origin "v${VERSION}"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e24998b8b67b290c2fa8b7c14fcfa7de2c5c9b8c # v7.1.0
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
main: ./cmd/gmailctl
ldflags:
- -s -w -X github.com/mbrt/gmailctl/cmd/gmailctl/cmd.version={{.Version}}

archives:
- formats:
- tar.gz
name_template: "gmailctl_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
formats:
- zip

checksum:
name_template: checksums.txt
algorithm: sha256

release:
draft: false
prerelease: auto
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ This project then exists to provide to your Gmail filters:

## Install

Pre-built binaries for Linux, macOS, and Windows (amd64 and arm64) are available
on the [GitHub releases page](https://github.com/mbrt/gmailctl/releases). Download
the archive for your platform, extract it, and place the `gmailctl` binary somewhere
in your `$PATH`.

Alternatively, if you have Go installed, you can build and install from source:

gmailctl is written in Go and requires a recent version (see [go.mod](go.mod)).
Make sure to setup your [`$GOPATH`](https://golang.org/doc/code.html#GOPATH)
correctly and include its `bin` subdirectory in your `$PATH`.
Expand All @@ -75,7 +82,7 @@ correctly and include its `bin` subdirectory in your `$PATH`.
go install github.com/mbrt/gmailctl/cmd/gmailctl@latest
```

Alternatively, if you're on macOS, you can install easily via Homebrew or Macports:
If you're on macOS, you can also install via Homebrew or Macports:

```
# Install with Homebrew
Expand Down
3 changes: 1 addition & 2 deletions cmd/gmailctl/cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package cmd

// DO NOT EDIT manually! Generated by hack/update-version.sh
var version = "0.11.0-dev"
var version = "dev"
14 changes: 0 additions & 14 deletions hack/update-version.sh

This file was deleted.

Loading