Skip to content

Commit

Permalink
Merge pull request #31 from simelo/stdevHan_t18_doc_release
Browse files Browse the repository at this point in the history
Fixes #18 Document release procedure
  • Loading branch information
olemis authored May 19, 2019
2 parents b3004b0 + 4b803d3 commit 5112f83
Show file tree
Hide file tree
Showing 6 changed files with 483 additions and 37 deletions.
42 changes: 28 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,56 @@ services:
- docker
language: go
go:
- "1.11.x"

matrix:
include:
- os: linux
dist: xenial
- os: osx
osx_image: xcode8.3

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq;
fi
- ./ci-scripts/install-travis-gcc.sh
- eval "CC=gcc-6 && CXX=g++-6"

env:
global:
- BUILD_DIR: build
- BUILDLIB_DIR: $BUILD_DIR/libskycoin
- BUILDLIB_DIR: "$BUILD_DIR/libskycoin"
- LIB_DIR: lib
- CGO_ENABLED: 1
- VERSION_UPGRADE_TEST_WAIT_TIMEOUT: 60s
- PATH_DIR: $GOPATH/src/github.com/skycoin/libskycoin/


- PATH_DIR: "$GOPATH/src/github.com/skycoin/libskycoin/"
install:
# Install gox
- go get github.com/gz-c/gox
- go get -t ./...
- make install-linters
- VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" && mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && travis_retry wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH && cd ${TRAVIS_BUILD_DIR}; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get install cmake ;
fi
- make install-deps-libc
- make install-lib-curl

script:
- make check

before_deploy:
- export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)"
- export ARCH="$(uname -m)"
- export OS="$(uname -s)"
- make build
- tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C build ./*
deploy:
- provider: releases
api_key:
secure: ZqagrrwPFXs4bgHV9lJkZaex6dxAEUJprSdhsqJLYTkF4uBN5VYNM4KCy+azBabV8pVLxiCCZ8G/ocRw+omQgzJ/1lymNtYez8C/SLAuKzOFxdTxkvyQ9pW5Xr+fjptTEpe/E/lRYvS6LFtQEEpbrtjW/km9HWc7EdMNxUaGhBCRun0YhK3a7JSpQE7JbsyR691Zco8hLb2b5PO8qYx5NoVWHKPMLMYUZhbSZbWs0Viu8s8t9VLVhrSIudAKnQiNs5viWp0YZy6U6mRMuBeZ7wazebx0d/BAj78f+atGOZIiJbHgOxupnhhgR10X7b5B89JggxVe3IFr5t96qz3VV4aTl1yuLZ3i8eYanMIvdirnpPU36bbfAVMJuG7L4hFmZ+pD22ZmiOI4COqHDxSd0gF8DUri+Cf9S+5RF5Kk3YBArQzdue6DjNPBtKyQja1xINfj3Go2LQnaKH+/ffzBJIlw9TICcqf241FS3bNtx0QvUDV/+ezqy0dcD7xKOoUQmLDhyWt5NltNKu/JjoCwj99B9P45GQHJCrSvMu71hwNYlTJxtTJuLIVRXqI5BUEGpnBK99MV+6nycl0ePla4zXTBbJ/uOFzwfj1njAdw2DT4ceTsvtkTAc9qEi3S1hrRL2z3mHQ4loZCTJ9Nn9Cx0WOgfs/bCDvExa7b+AJ3ScE=
file:
- libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz
skip_cleanup: true
draft: true
overwrite: true
on:
repo: skycoin/hardware-wallet
tags: true
notifications:
email: false
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ $(BUILDLIB_DIR)/libskycoin.a: $(LIB_FILES) $(SRC_FILES) $(HEADER_FILES)
go build -buildmode=c-archive -o $(BUILDLIB_DIR)/libskycoin.a $(LIB_FILES)
mv $(BUILDLIB_DIR)/libskycoin.h $(INCLUDE_DIR)/

## Build libskycoin C static library
build-libc-static: $(BUILDLIB_DIR)/libskycoin.a
build-libc-static: $(BUILDLIB_DIR)/libskycoin.a ## Build libskycoin C static library

## Build libskycoin C shared library
build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so
build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared library

## Build libskycoin C client libraries
build-libc: configure-build build-libc-static build-libc-shared
build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries

build: build-libc ## Build all C libraries

## Build libskycoin C client library and executable C test suites
## with debug symbols. Use this target to debug the source code
Expand Down Expand Up @@ -140,6 +139,7 @@ lint-libc: format-libc
check: lint test-libc lint-libc ## Run tests and linters

install-linters-Linux: ## Install linters on GNU/Linux
sudo apt-get update
sudo apt-get install $(PKG_CLANG_FORMAT)
sudo apt-get install $(PKG_CLANG_LINTER)

Expand All @@ -165,10 +165,7 @@ install-libraries-deps: ## Install deps for lib\curl wrapper of Skycoin REST API

install-linters: install-linters-$(UNAME_S) ## Install linters
go get -u github.com/FiloSottile/vendorcheck
# For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install
# However, they suggest `curl ... | bash` which we should not do
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh
cat ./ci-scripts/install-golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.10.2

install-deps-libc: install-deps-libc-$(OSNAME) install-libraries-deps

Expand Down
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,59 @@ The Skycoin C library is made of the following components

Consult respective `README` files for further details.

<!-- MarkdownTOC levels="1,2,3,4,5" autolink="true" bracket="round" -->
- [Make rules](#make-rules)
- [Development setup](#development-setup)
- [Running tests](#running-tests)
- [Releases](#releases)
- [Update the version](#update-the-version)
- [Pre-release testing](#pre-release-testing)
- [Creating release builds](#creating-release-builds)
<!-- /MarkdownTOC -->

## Make Rules

All these make rules require skycoin to be a git submodule of pyskycoin

- `build-libc`
* Compiles skycoin C language library.
- `test-libc`
* Compiles skycoin C language library and executes the tests.
- `build-libc-static`
* Build libskycoin C static library
- `build-libc-shared`
* Build libskycoin C shared library


## Development setup

### Running tests

```sh
$ make test-libc
```

### Releases

#### Update the version

0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures)
0. Switch to a new release branch named `release-X.Y.Z` for preparing the release.
0. Ensure that the submodule at `gopath/src/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository.
0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date.
0. Follow the steps in [pre-release testing](#pre-release-testing)
0. Make a PR merging the release branch into `master`
0. Review the PR and merge it
0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release".
0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds).

#### Pre-release testing

Perform these actions before releasing:

```sh
make check
```
## Development

We have two branches: `master` and `develop`.
Expand Down Expand Up @@ -60,6 +113,12 @@ The following rules are enforced
- Contributions must comply to the development guidelines documented in the [Skycoin wiki](https://github.com/skycoin/skycoin/wiki).
- C / C++ code must comply to the [Bitcoin C coding style](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#coding-style-c) (enforced by `clang-format`).

### SkyApi libcurl client for Skycoin REST API

This wrapper is auto-generated by `openapi-generator` directly from [Skycoin REST API code](https://github.com/skycoin/skycoin/tree/master/src/api).

For further instructions see [Autogenerated documentation](./lib/curl/README.md).

### Doxygen comment syntax

If you want to continue with `the doxygen way`(we recommend it) of coding and document functions, structs, and functions, you should follow the specifications found in the [Doxygen official site](http://www.doxygen.nl/manual/docblocks.html).
Expand Down Expand Up @@ -87,6 +146,10 @@ After that, run `make docs` for a new docs generation. You can found the api doc

|Target |Help|
| :------------- | :----------: |
|build-libc-static |Build libskycoin C static library|
|build-libc-shared |Build libskycoin C shared library|
|build-libc |Build libskycoin C client libraries|
|build |Build all C libraries
|test-libc |Run tests for libskycoin C client library|
|docs |Generate documentation for all libraries|
|docs-libc |Generate libskycoin documentation|
Expand All @@ -104,3 +167,4 @@ After that, run `make docs` for a new docs generation. You can found the api doc
|install-deps-libc-osx |Install locally dependencies for testing libskycoin|
|format |Formats the code. Must have goimports installed (use make install-linters).|
|clean-libc |Clean files generate by library|

2 changes: 2 additions & 0 deletions ci-scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Init"
make -C $GOPATH/src/github.com/skycoin/libskycoin build-libc
Loading

0 comments on commit 5112f83

Please sign in to comment.