Skip to content

Commit 8dfaa85

Browse files
committed
A release script
1 parent 9adb705 commit 8dfaa85

File tree

6 files changed

+56
-31
lines changed

6 files changed

+56
-31
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GITHUB_USER="amireh"
2+
GITHUB_REPO="lua_cliargs"
3+
GITHUB_TOKEN=

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/luacov.report.out
2-
/luacov.stats.out
2+
/luacov.stats.out
3+
/.env.local

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ A function reference was generated using [LunaDoc](http://jgm.github.com/lunamar
126126
127127
## Changelog
128128
129+
Changes in 2.3.0
130+
131+
1. the parser will now understand `--` to denote the end of optional arguments and will map whatever comes after it to required/splat args
132+
2. `-short VALUE` is now properly supported, so is `-short=VALUE`
133+
3. short-key options can now officially be composed of more than 1 character
134+
4. the parser now accepts callbacks that will be invoked as soon as options are parsed so that you can bail out of parsing preemptively (like for `--version` or `--help` options)
135+
5. options can now accept multiple values via multiple invocations if a table was provided as a default value (passed-in values will be appended to that list)
136+
129137
Changes in 2.2-0 from 2.1-2
130138
131139
1. the `=` that separates keys from values in the `--expanded-key` notation is no longer mandatory; using either a space or a `=` will map the value to the key (e.g., `--compress lzma` is equal to `--compress=lzma`)

bin/release

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
[ -f ".env" ] && source ".env"
4+
[ -f ".env.local" ] && source ".env.local"
5+
6+
function abort {
7+
echo -e "\e[00;31m[ FAILED ]\e[00m ${1}"
8+
exit 1
9+
}
10+
11+
[ -z "${GITHUB_TOKEN}" ] && abort "Missing GITHUB_TOKEN env variable."
12+
[ -z "${GITHUB_USER}" ] && abort "Missing GITHUB_USER env variable."
13+
[ -z "${GITHUB_REPO}" ] && abort "Missing GITHUB_REPO env variable."
14+
15+
VERSION=$(grep "version" lua_cliargs-*.rockspec | cut -d' ' -f3 | sed 's/"//g')
16+
17+
# Publish to GitHub
18+
JSON_PAYLOAD=$(
19+
printf '{
20+
"tag_name": "v%s",
21+
"target_commitish": "master",
22+
"name": "v%s",
23+
"body": "Release of version %s",
24+
"draft": false,
25+
"prerelease": false
26+
}' $VERSION $VERSION $VERSION
27+
)
28+
29+
echo $JSON_PAYLOAD
30+
echo "Releasing version ${VERSION}..."
31+
32+
# the API will automatically create the tag for us, no need to do it manually!
33+
curl \
34+
--data "$JSON_PAYLOAD" \
35+
-X POST \
36+
-H "Content-Type: application/json; charset=utf-8" \
37+
-H "Accept: application/json" \
38+
"https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases?access_token=${GITHUB_TOKEN}"
39+
40+
echo -e "\e[00;32m[ SUCCESS ]\e[00m"

lua_cliargs-2.2-0.rockspec renamed to lua_cliargs-2.3-0.rockspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package = "lua_cliargs"
2-
version = "2.2-0"
2+
version = "2.3-0"
33
source = {
4-
url = "https://github.com/downloads/amireh/lua_cliargs/lua_cliargs-2.2.tar.gz",
5-
dir = "lua_cliargs-2.2"
4+
url = "https://github.com/downloads/amireh/lua_cliargs/lua_cliargs-2.3-0.tar.gz",
5+
dir = "lua_cliargs-2.3-0"
66
}
77
description = {
88
summary = "A command-line argument parser.",

tarballs/create_tarball.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)