Skip to content

Commit 5c8ea49

Browse files
committed
- [*] update README
1 parent 88388c2 commit 5c8ea49

File tree

2 files changed

+31
-494
lines changed

2 files changed

+31
-494
lines changed

README.e.md

Lines changed: 11 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -26,74 +26,9 @@ It illustrates
2626
Check out the executables and package building log here:
2727
https://travis-ci.org/go-easygen/wireframe/builds/265785563
2828

29-
# wire-frame building
29+
# Go wire-frame building
3030

31-
## github-create-repo - Create Repository in Github
32-
33-
```sh
34-
# Create an organization Github Repository
35-
$ easygen -tf github-create-repo.tmpl wireframe_proj.yaml
36-
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/orgs/repos -d '{"name":"wireframe", "description": "wire-frame construction to get the project quickly into shape", "auto_init": true, "license_template": "mit", "gitignore_template": "Go"}'
37-
38-
# Create a normal user Github Repository
39-
sed 's/^ Vendor: go-easygen/ User: suntong/' wireframe_proj.yaml > /tmp/wireframe_proj.yaml
40-
41-
$ easygen -tf github-create-repo.tmpl /tmp/wireframe_proj.yaml
42-
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user/repos -d '{"name":"wireframe", "description": "wire-frame construction to get the project quickly into shape", "auto_init": true, "license_template": "mit", "gitignore_template": "Go"}'
43-
44-
```
45-
46-
The GitHub Token is for accessing [GitHub API](https://developer.github.com/v3) to create repository or deploy the artefacts to GitHub etc. You can create one [here](https://github.com/settings/tokens/new).
47-
48-
## gitlab-repo-create - Create Repository in Gitlab
49-
50-
```sh
51-
ghrn=wireframe
52-
ghrd='wire-frame construction to get the project quickly into shape'
53-
ghun=go-easygen
54-
GITLAB_TOKEN=xxxx
55-
56-
namespace_id=`curl -s --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v3/namespaces" | jq --arg name $ghun '.[] | select(.name==$name) | .id'`
57-
58-
curl -H "Content-Type:application/json" https://gitlab.com/api/v3/projects?private_token=$GITLAB_TOKEN -d "{ \"name\": \"$ghrn\", \"description\": \"$ghrd\", \"namespace_id\": $namespace_id"',"only_allow_merge_if_build_succeeds":true,"only_allow_merge_if_all_discussions_are_resolved":true}'
59-
```
60-
61-
62-
## Data type def
63-
64-
<details>
65-
<summary>
66-
Data type def
67-
</summary>
68-
69-
```sh
70-
$ jsonfiddle j2s -f yaml -i wireframe_full.yaml --name WireframeT | sed '/Wireframe\b/d; s/ `yaml:.*$//' | gofmt | tee WireframeT.go
71-
package main
72-
73-
type WireframeT struct {
74-
Author string
75-
Desc string
76-
Lang string
77-
License string
78-
Proj string
79-
User string
80-
Vendor string
81-
}
82-
83-
$ cat wireframe_full.yaml
84-
Wireframe:
85-
Proj: wireframe
86-
Desc: wire-frame construction to get the project quickly into shape
87-
Lang: Go
88-
User: <empty>
89-
Vendor: go-easygen
90-
Author: Tong Sun <[email protected]>
91-
License: MIT
92-
```
93-
94-
</details>
95-
96-
The `jsonfiddle` is the JSON Fiddling tool that makes it easy to look at the JSON data from different aspects, which is [available here](https://github.com/go-jsonfile/jsonfiddle).
31+
The detailed explanation on the [Go wire-frame building can be found here]( https://github.com/go-easygen/wireframe/wiki/Go-project-wire-frame-building).
9732

9833
## Command line flag handling code auto-generation
9934

@@ -102,189 +37,20 @@ Refer to
10237
[Command line flag handling code auto-generation](https://github.com/go-easygen/wireframe/wiki/Command-line-flag-handling-code-auto-generation#auto-gen)
10338

10439

105-
## github-create-release - Create Release in Github
106-
107-
```
108-
GITHUB_TOKEN=...
109-
110-
GITHUB_TAG=1.0.0
111-
GITHUB_RELEASE_TEXT="Release v$GITHUB_TAG"
112-
113-
git push
114-
115-
$ easygen -tf ../../go-easygen/wireframe/github-create-release.tmpl wireframe_proj.yaml
116-
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/go-easygen/wireframe/releases -d '{"tag_name":"'$GITHUB_TAG'", "name": "wireframe-'$GITHUB_TAG'", "body": "'"$GITHUB_RELEASE_TEXT"'"}'
117-
118-
```
119-
120-
The copy and do the `curl` command on the command line. E.g.:
121-
122-
With `curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/go-easygen/wireframe/releases -d '{"tag_name":"'$GITHUB_TAG'", "name": "wireframe-'$GITHUB_TAG'", "body": "'"$GITHUB_RELEASE_TEXT"'"}'` for `wireframe`:
123-
124-
```json
125-
{
126-
"url": "https://api.github.com/repos/go-easygen/wireframe/releases/14826407",
127-
"assets_url": "https://api.github.com/repos/go-easygen/wireframe/releases/14826407/assets",
128-
"upload_url": "https://uploads.github.com/repos/go-easygen/wireframe/releases/14826407/assets{?name,label}",
129-
"html_url": "https://github.com/go-easygen/wireframe/releases/tag/1.0.0",
130-
"id": 14826407,
131-
"node_id": "MDc6UmVsZWFzZTE0ODI2NDA3",
132-
"tag_name": "1.0.0",
133-
"target_commitish": "master",
134-
"name": "wireframe-1.0.0",
135-
"draft": false,
136-
"author": {
137-
"login": "suntong",
138-
"id": 422244,
139-
"node_id": "MDQ6VXNlcjQyMjI0NA==",
140-
"avatar_url": "https://avatars1.githubusercontent.com/u/422244?v=4",
141-
"gravatar_id": "",
142-
"url": "https://api.github.com/users/suntong",
143-
"html_url": "https://github.com/suntong",
144-
"followers_url": "https://api.github.com/users/suntong/followers",
145-
"following_url": "https://api.github.com/users/suntong/following{/other_user}",
146-
"gists_url": "https://api.github.com/users/suntong/gists{/gist_id}",
147-
"starred_url": "https://api.github.com/users/suntong/starred{/owner}{/repo}",
148-
"subscriptions_url": "https://api.github.com/users/suntong/subscriptions",
149-
"organizations_url": "https://api.github.com/users/suntong/orgs",
150-
"repos_url": "https://api.github.com/users/suntong/repos",
151-
"events_url": "https://api.github.com/users/suntong/events{/privacy}",
152-
"received_events_url": "https://api.github.com/users/suntong/received_events",
153-
"type": "User",
154-
"site_admin": false
155-
},
156-
"prerelease": false,
157-
"created_at": "2019-01-07T03:51:46Z",
158-
"published_at": "2019-01-07T04:15:30Z",
159-
"assets": [
160-
161-
],
162-
"tarball_url": "https://api.github.com/repos/go-easygen/wireframe/tarball/1.0.0",
163-
"zipball_url": "https://api.github.com/repos/go-easygen/wireframe/zipball/1.0.0",
164-
"body": "Release v1.0.0"
165-
}
166-
167-
```
168-
169-
For `ffcvt`:
170-
171-
```
172-
$ easygen -tf ../../go-easygen/wireframe/github-create-release.tmpl ffcvt_proj.yaml
173-
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/suntong/ffcvt/releases -d '{"tag_name":"'$GITHUB_TAG'", "name": "ffcvt-'$GITHUB_TAG'", "body": "'"$GITHUB_RELEASE_TEXT"'"}'
174-
175-
GITHUB_TAG=1.3.2
176-
GITHUB_RELEASE_TEXT="Add subtitle streams copy support"
177-
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/suntong/ffcvt/releases -d '{"tag_name":"'$GITHUB_TAG'", "name": "ffcvt-'$GITHUB_TAG'", "body": "'"$GITHUB_RELEASE_TEXT"'"}'
178-
179-
```
180-
181-
will get:
182-
183-
```json
184-
{
185-
"url": "https://api.github.com/repos/suntong/ffcvt/releases/14826435",
186-
"assets_url": "https://api.github.com/repos/suntong/ffcvt/releases/14826435/assets",
187-
"upload_url": "https://uploads.github.com/repos/suntong/ffcvt/releases/14826435/assets{?name,label}",
188-
"html_url": "https://github.com/suntong/ffcvt/releases/tag/1.3.2",
189-
"id": 14826435,
190-
"node_id": "MDc6UmVsZWFzZTE0ODI2NDM1",
191-
"tag_name": "1.3.2",
192-
"target_commitish": "master",
193-
"name": "ffcvt-1.3.2",
194-
"draft": false,
195-
"author": {
196-
"login": "suntong",
197-
"id": 422244,
198-
"node_id": "MDQ6VXNlcjQyMjI0NA==",
199-
"avatar_url": "https://avatars1.githubusercontent.com/u/422244?v=4",
200-
"gravatar_id": "",
201-
"url": "https://api.github.com/users/suntong",
202-
"html_url": "https://github.com/suntong",
203-
"followers_url": "https://api.github.com/users/suntong/followers",
204-
"following_url": "https://api.github.com/users/suntong/following{/other_user}",
205-
"gists_url": "https://api.github.com/users/suntong/gists{/gist_id}",
206-
"starred_url": "https://api.github.com/users/suntong/starred{/owner}{/repo}",
207-
"subscriptions_url": "https://api.github.com/users/suntong/subscriptions",
208-
"organizations_url": "https://api.github.com/users/suntong/orgs",
209-
"repos_url": "https://api.github.com/users/suntong/repos",
210-
"events_url": "https://api.github.com/users/suntong/events{/privacy}",
211-
"received_events_url": "https://api.github.com/users/suntong/received_events",
212-
"type": "User",
213-
"site_admin": false
214-
},
215-
"prerelease": false,
216-
"created_at": "2019-01-07T02:56:43Z",
217-
"published_at": "2019-01-07T04:20:21Z",
218-
"assets": [
219-
220-
],
221-
"tarball_url": "https://api.github.com/repos/suntong/ffcvt/tarball/1.3.2",
222-
"zipball_url": "https://api.github.com/repos/suntong/ffcvt/zipball/1.3.2",
223-
"body": "Add subtitle streams copy support"
224-
}
225-
226-
```
227-
228-
229-
230-
## Binary releases
231-
232-
``` sh
233-
gpkg=$(basename $(pwd))
234-
235-
export BINTRAY_USER=suntong BINTRAY_REPO_BIN=bin
236-
easygen -tf bintray-bin ${gpkg}_proj | tee bintray-bin.json
237-
238-
export BINTRAY_REPO_DEB=deb PKG1ST=`expr $gpkg : '^\(.\)'`
239-
easygen -tf bintray-pkg ${gpkg}_proj | tee bintray-pkg.json
240-
241-
export PKG_MAINT="My Name <[email protected]>"
242-
easygen -tf travis ${gpkg}_proj | tee .travis.yml
243-
```
244-
245-
Then,
246-
247-
- inspect the generated `bintray-bin.json`, `bintray-pkg.json`, and `.travis.yml`.
248-
- try to do a `git push` and manually fix any remaining issues.
249-
250-
The `easygen` is the universal code/text generator, which is [available here](https://github.com/go-easygen/easygen).
251-
252-
The above steps assume that the user and the `BINTRAY_REPO_BIN` and `BINTRAY_REPO_DEB` repos are already exist on [bintray.com](https://bintray.com/). Check out the [Hosting Debian Packages on Bintray](https://blog.bintray.com/2014/12/16/hosting-debian-packages-on-bintray-rocks/) for details, and [Bintray Debian Repository Creation and Upload file using API](https://stackoverflow.com/questions/45516482/bintray-debian-repository-creation-and-upload-file-using-api/45519360#45519360) for the condensed and practical version. All you need to do before doing the above steps are,
253-
254-
- Create an Bintray account (free).
255-
- Obtain `BINTRAY_API_KEY` from its web site.
256-
- Create two repos for binary executables (`BINTRAY_REPO_BIN`) and debian packages (`BINTRAY_REPO_DEB`).
257-
258-
That's it. The above steps should take care of the rest.
259-
26040

26141
# Download/Install
26242

43+
_(The following is the base template for all `wireframe` based projects)_
44+
26345
## Download binaries
26446

265-
- The latest binary executables are available under
266-
https://bintray.com/suntong/bin/{{.Name}}/latest, or directly under
267-
https://bintray.com/version/files/suntong/bin/{{.Name}}/latest
47+
- The latest binary executables are available right under the github release page
48+
https://github.com/suntong/{{.Name}}/releases
26849
as the result of the Continuous-Integration process.
269-
- I.e., they are built during every git push, automatically by [travis-ci](https://travis-ci.org/), right from the source code, truely WYSIWYG.
270-
- Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the `{{.Name}}-linux-amd64` file. If your OS and its architecture is not available in the download list, please let me know and I'll add it.
271-
- You may want to rename it to a shorter name instead, e.g., `{{.Name}}`, after downloading it.
272-
273-
274-
## Debian package
275-
276-
Available at https://bintray.com/suntong/deb/{{.Name}},
277-
or directly at https://dl.bintray.com/suntong/deb:
278-
279-
```
280-
echo "deb [trusted=yes] https://dl.bintray.com/suntong/deb all main" | sudo tee /etc/apt/sources.list.d/suntong-debs.list
281-
sudo apt-get update
282-
283-
sudo chmod 644 /etc/apt/sources.list.d/suntong-debs.list
284-
apt-cache policy {{.Name}}
285-
286-
sudo apt-get install -y {{.Name}}
287-
```
50+
- I.e., they are built during every git tagged push, automatically by [GitHub Actions](https://github.com/features/actions), right from the source code, truely WYSIWYG.
51+
- The `.deb`, `.rpm` and `.apk` packages are readily available, as well as the executables for other Linux and Windows as well.
52+
- Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the `{{.Name}}_ver_linux_amd64.tar.gz` file.
53+
- Unzip it and put the executable somewhere in the PATH, after downloading it.
28854

28955

29056
## Install Source
@@ -298,7 +64,7 @@ go get github.com/go-easygen/wireframe
29864

29965
# Similar Projects
30066

301-
All the following similar projects have been attempted before rolling out on my own solution instead. The listed url points to the limitations they have by the time this project was created.
67+
At the beginning, all the following similar projects have been attempted before rolling out on my own solution instead. The listed url points to the limitations they had, _by the time this project was created_.
30268

30369
- [**goreleaser**](https://github.com/goreleaser/goreleaser/issues/15#issuecomment-321949280)
30470
- [**go-github-release**](https://github.com/mh-cbon/go-github-release/issues/6), and also see the issues [here](https://github.com/mh-cbon/go-github-release/issues/10#issuecomment-307646985), [here](https://github.com/mh-cbon/go-github-release/issues/18) and [here](https://github.com/mh-cbon/go-github-release/issues/20).

0 commit comments

Comments
 (0)