Coder Social home page Coder Social logo

semantic-release's Introduction

๐Ÿ“ฆ๐Ÿš€ semantic-release

Build Status

fully automated package/module/image publishing

A more lightweight and standalone version of semantic-release.

How does it work?

Instead of writing meaningless commit messages, we can take our time to think about the changes in the codebase and write them down. Following the AngularJS Commit Message Conventions it is then possible to generate a helpful changelog and to derive the next semantic version number from them.

When semantic-release is setup it will do that after every successful continuous integration build of your master branch (or any other branch you specify) and publish the new version for you. This way no human is directly involved in the release process and your releases are guaranteed to be unromantic and unsentimental.

Source: semantic-release/semantic-release#how-does-it-work

You can enforce semantic commit messages using a git hook.

Installation

Install the latest version of semantic-release

curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release && chmod +x ./semantic-release

Example GitHub Release

GitHub token

It is necessary to create a new GitHub token with the repo or public_repo scope here. You can set the GitHub token via the GITHUB_TOKEN environment variable or the -token flag.

.travis.yml

language: go
go:
  - 1.x
install:
  - curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ~/semantic-release && chmod +x ~/semantic-release
  - go get github.com/mitchellh/gox
  - go get github.com/tcnksm/ghr
after_success:
  - ./release
notifications:
  email: false

release

#!/bin/bash
set -e

~/semantic-release -ghr -vf
export VERSION=$(cat .version)
gox -ldflags="-s -w" -output="bin/{{.Dir}}_v"$VERSION"_{{.OS}}_{{.Arch}}"
ghr $(cat .ghr) bin/

Example Docker Hub

The environment variables GITHUB_TOKEN, DOCKER_USERNAME and DOCKER_PASSWORD must be set.

.travis.yml

language: go
services:
  - docker
go:
  - 1.x
install:
  - curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ~/semantic-release && chmod +x ~/semantic-release
after_success:
  - ./release
notifications:
  email: false

release

#!/bin/bash

set -e

# run semantic-release
~/semantic-release -vf
export VERSION=$(cat .version)

# docker build
export IMAGE_NAME="user/imagename"
export IMAGE_NAME_VERSION="$IMAGE_NAME:$VERSION"

docker build -t $IMAGE_NAME_VERSION .
docker tag $IMAGE_NAME_VERSION $IMAGE_NAME

# push to docker hub
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker push $IMAGE_NAME_VERSION
docker push $IMAGE_NAME

Example npm

The environment variables GITHUB_TOKEN and NPM_TOKEN must be set.

.travis.yml

language: node_js
cache:
  directories:
    - node_modules
notifications:
  email: false
node_js:
  - '7'
  - '6'
  - '4'
after_success:
  - curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ~/semantic-release && chmod +x ~/semantic-release
  - ~/semantic-release -update package.json && npm publish
branches:
  except:
    - /^v\d+\.\d+\.\d+$/

Beta release support

Beta release support empowers you to release beta, rc, etc. versions with semantic-release (e.g. v2.0.0-beta.1). To enable this feature you need to create a new branch (e.g. beta/v2) and check in a .semrelrc file with the following content:

{
  "maintainedVersion": "2-beta"
}

If you commit to this branch a new incremental pre-release is created everytime you push. (2.0.0-beta.1, 2.0.0-beta.2, ...)

Licence

The MIT License (MIT)

Copyright ยฉ 2017 Christoph Witzko

semantic-release's People

Contributors

christophwitzko avatar vvbogdanov87 avatar hazcod avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.