Skip to content

Commit d715afa

Browse files
committed
Update release flow
1 parent 5dbd68d commit d715afa

File tree

4 files changed

+64
-59
lines changed

4 files changed

+64
-59
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,32 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "[0-9]+.[0-9]+.[0-9]+"
6+
- "v*" # Match all version tags (v1.0.0, v2.0.0-beta.1, etc.)
77
jobs:
88
main:
99
name: Main
1010
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Fetch all history for changelog generation
1517
- name: Setup Go
16-
uses: actions/setup-go@v2
18+
uses: actions/setup-go@v5
1719
with:
18-
go-version: 1.19
20+
go-version: "1.19"
1921
- name: Get dependencies
2022
run: make deps
2123
- name: Build
2224
run: make
2325
- name: Test
2426
run: go test
2527
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v3
28+
uses: goreleaser/goreleaser-action@v6
2729
with:
28-
version: latest
29-
args: release --rm-dist
30+
version: "~> v2"
31+
args: release --clean
3032
env:
3133
# set github personal access token in order to generate brew formula to external repository
3234
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.goreleaser.yaml

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# This is an example .goreleaser.yml file with some sensible defaults.
22
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# GoReleaser v2 configuration
5+
version: 2
6+
37
before:
48
hooks:
59
# You may remove this if you don't use go modules.
@@ -14,19 +18,23 @@ builds:
1418
- windows
1519
- darwin
1620
archives:
17-
- replacements:
18-
darwin: Darwin
19-
linux: Linux
20-
windows: Windows
21-
386: i386
22-
amd64: x86_64
21+
- name_template: >-
22+
{{ .ProjectName }}_
23+
{{- title .Os }}_
24+
{{- if eq .Arch "amd64" }}x86_64
25+
{{- else if eq .Arch "386" }}i386
26+
{{- else }}{{ .Arch }}{{ end }}
27+
{{- if .Arm }}v{{ .Arm }}{{ end }}
2328
format_overrides:
2429
- goos: windows
2530
format: zip
31+
files:
32+
- README.md
33+
- LICENSE*
2634
checksum:
2735
name_template: 'checksums.txt'
2836
snapshot:
29-
name_template: "{{ incpatch .Version }}-next"
37+
version_template: "{{ incpatch .Version }}-next"
3038
changelog:
3139
sort: asc
3240
filters:
@@ -39,40 +47,36 @@ changelog:
3947
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
4048

4149
brews:
42-
-
43-
# Name template of the recipe
44-
# Default to project name
45-
name: aurl
50+
- name: aurl
51+
# Skip Homebrew update for pre-releases (beta versions)
52+
skip_upload: auto
4653

4754
# GitHub/GitLab repository to push the formula to
48-
tap:
55+
repository:
4956
owner: classmethod
5057
name: homebrew-repos
5158

52-
# Template for the url which is determined by the given Token (github,
53-
# gitlab or gitea)
54-
#
55-
# Default depends on the client.
56-
# url_template: "http://github.mycompany.com/foo/bar/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
57-
58-
# Git author used to commit to the repository.
59-
# Defaults are shown.
59+
# Git author used to commit to the repository
6060
commit_author:
6161
name: goreleaserbot
6262
email: bot@goreleaser.com
6363

64-
# The project name and current git tag are used in the format string.
64+
# Commit message template
6565
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
6666

67-
# So you can `brew test` your formula.
68-
# Default is empty.
69-
test: |
70-
system "#{bin}/aurl --version"
71-
# ...
67+
# Directory inside the repository to put the formula
68+
directory: Formula
7269

73-
# Custom install script for brew.
74-
# Default is 'bin.install "the binary name"'.
70+
# Homepage of the project
71+
homepage: "https://github.com/classmethod/aurl"
72+
73+
# Description of the project
74+
description: "URL Command Line Tool with Authentication Support"
75+
76+
# Custom install script for brew
7577
install: |
7678
bin.install "aurl"
77-
# bash_completion.install "completions/aurl.bash" => "aurl"
78-
# ...
79+
80+
# Test script for brew
81+
test: |
82+
system "#{bin}/aurl --version"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ test:
2626

2727
.PHONY: gorelease
2828
gorelease:
29-
goreleaser release --snapshot --rm-dist
29+
goreleaser release --snapshot --clean

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
aurl
2-
====
1+
# aurl
32

43
![Release](https://github.com/classmethod/aurl/workflows/Release/badge.svg)
54
[![License](https://img.shields.io/github/license/classmethod/aurl.svg)](https://github.com/classmethod/aurl/blob/master/LICENSE)
@@ -10,11 +9,11 @@ HTTP CLI client with OAuth 2.0 authentication.
109

1110
You know `curl` is powerful command line tool and you can make any complex HTTP request to every servers.
1211
But the target web server is secured by OAuth 2.0, you must send another HTTP request to the authorization server
13-
before making principal request. And more, you should to manage issued access tokens for every resources.
12+
before making principal request. And more, you should to manage issued access tokens for every resources.
1413

1514
`aurl` is a command-line tool that process OAuth 2.0 dance and manage access/refresh tokens automatically.
1615

17-
**Note:** Currently, `aurl` is not support OAuth 1.0a. Your pull-request is appreciated.
16+
**Note:** Currently, `aurl` is not support OAuth 1.0a. Your pull-request is appreciated.
1817

1918
## Install
2019

@@ -51,21 +50,21 @@ Each section name is used as profile name.
5150

5251
###### SYNOPSIS
5352

54-
Section name is utilized as profile name. In each section following key settings are available:
55-
56-
| key name | description | default value | available values | mandatory |
57-
| ----------------------------- | --------------------------------- |:-------------:|:----------------:|:-------------------------------:|
58-
| grant\_type | OAuth2 grant type | authorization_code | authorization_code, password, client_credentials | no |
59-
| client\_id | client id | aurl | (any) | no |
60-
| client_secret | client secret | aurl | (any) | no |
61-
| auth\_server\_auth\_endpoint | OAuth2 authorization endpoint URI | (none) | (any) | YES (except for password grant) |
62-
| auth\_server\_token\_endpoint | OAuth2 token endpoint URI | (none) | (any) | YES |
63-
| redirect | redirect URI | (none) | (any) | YES (except for password grant) |
64-
| scopes | space separated scope values | read write | (any) | no |
65-
| username | username for password grant | (none) | (any) | no (except for password grant) |
66-
| password | password for password grant | (none) | (any) | no (except for password grant) |
67-
| default\_content\_type | default content type header | (none) | (any) | no |
68-
| default\_user\_agent | default user agent header | aurl x.x.x | (any) | no |
53+
Section name is utilized as profile name. In each section following key settings are available:
54+
55+
| key name | description | default value | available values | mandatory |
56+
| -------------------------- | --------------------------------- | :----------------: | :----------------------------------------------: | :-----------------------------: |
57+
| grant_type | OAuth2 grant type | authorization_code | authorization_code, password, client_credentials | no |
58+
| client_id | client id | aurl | (any) | no |
59+
| client_secret | client secret | aurl | (any) | no |
60+
| auth_server_auth_endpoint | OAuth2 authorization endpoint URI | (none) | (any) | YES (except for password grant) |
61+
| auth_server_token_endpoint | OAuth2 token endpoint URI | (none) | (any) | YES |
62+
| redirect | redirect URI | (none) | (any) | YES (except for password grant) |
63+
| scopes | space separated scope values | read write | (any) | no |
64+
| username | username for password grant | (none) | (any) | no (except for password grant) |
65+
| password | password for password grant | (none) | (any) | no (except for password grant) |
66+
| default_content_type | default content type header | (none) | (any) | no |
67+
| default_user_agent | default user agent header | aurl x.x.x | (any) | no |
6968

7069
Implicit flow is not supported currently.
7170

@@ -107,7 +106,7 @@ scopes = https://www.googleapis.com/auth/plus.login https://www.googleapis.com/a
107106

108107
### Token store file
109108

110-
Token store file `~/.aurl/token/*.json` is used by aurl internally. Retrieved token response body is stored in this file.
109+
Token store file `~/.aurl/token/*.json` is used by aurl internally. Retrieved token response body is stored in this file.
111110
You SHOULD NOT edit this file manually because this file is overwritten at any time curl is executed.
112111
You may lose comment and another extra data.
113112

@@ -158,7 +157,7 @@ $ aurl --profile google https://www.googleapis.com/plus/v1/people/me
158157
}
159158
```
160159

161-
By default aurl prints response body in stdout. When an error occured the detail is printed in stderr.
160+
By default aurl prints response body in stdout. When an error occured the detail is printed in stderr.
162161
You may want not response body but response header, then you can use `--no-print-body` and `--print-headers` option.
163162

164163
```bash

0 commit comments

Comments
 (0)