Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Continuous integration"

on:
push:
branches:
- dev
- feature/*

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Test
run: |
yarn install
yarn test
55 changes: 55 additions & 0 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Draft new release"

on:
issues:
types: [opened, labeled]

jobs:
draft-new-release:
runs-on: ubuntu-latest
if: startsWith(github.event.issue.title, 'Release version') && contains(github.event.issue.labels.*.name, 'release') # only run for issues with a specific title and label
steps:
- uses: actions/checkout@v2

- name: Extract version from issue title
run: |
TITLE="${{ github.event.issue.title }}"
VERSION=${TITLE#Release version }

echo "::set-env name=RELEASE_VERSION::$VERSION"

- name: Create release branch
run: git checkout -b release/${{ env.RELEASE_VERSION }}

- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@master
with:
version: ${{ env.RELEASE_VERSION }}

- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email noreply@github.com

# This step will differ depending on your project setup
- name: Bump version in package.json
run: yarn version --new-version ${{ env.RELEASE_VERSION }}

- name: Commit changelog and manifest files
run: |
git add CHANGELOG.md package.json
git commit --message "Prepare release ${{ env.RELEASE_VERSION }}"

- name: Push new branch
run: git push origin release/${{ env.RELEASE_VERSION }}

- name: Create pull request
uses: thomaseizinger/create-pull-request@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: release/${{ env.RELEASE_VERSION }}
base: master
title: ${{ github.event.issue.title }}
reviewers: ${{ github.event.issue.user.login }}
body: |
Resolves #${{ github.event.issue.number }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Release new version"

on:
pull_request:
branches:
- master
types:
- closed

jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Extract version from branch name
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}

echo "::set-env name=RELEASE_VERSION::$VERSION"
- uses: actions/checkout@v2
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node

branches:
only:
- release/*
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0] - 2020-02-15

### Added

- Everything since the beginning!

[Unreleased]: https://github.com/thomaseizinger/github-action-gitflow-release-workflow/compare/1.0.0...HEAD

[1.0.0]: https://github.com/thomaseizinger/github-action-gitflow-release-workflow/compare/794c3ba521cae6b168def8bdbfe1aa6a2c285257...1.0.0
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello world!");
5 changes: 5 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
it('works', function() {
const sum = 2 + 2;

expect(sum).toEqual(4);
});
Loading