Skip to content

Commit a78e166

Browse files
Merge pull request #4 from thomaseizinger/release/1.0.0
Release version 1.0.0
2 parents f29bb46 + 90ac0b0 commit a78e166

File tree

9 files changed

+3210
-0
lines changed

9 files changed

+3210
-0
lines changed

.github/workflows/CI.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Continuous integration"
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- feature/*
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v1
15+
- name: Test
16+
run: |
17+
yarn install
18+
yarn test
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Draft new release"
2+
3+
on:
4+
issues:
5+
types: [opened, labeled]
6+
7+
jobs:
8+
draft-new-release:
9+
runs-on: ubuntu-latest
10+
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
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Extract version from issue title
15+
run: |
16+
TITLE="${{ github.event.issue.title }}"
17+
VERSION=${TITLE#Release version }
18+
19+
echo "::set-env name=RELEASE_VERSION::$VERSION"
20+
21+
- name: Create release branch
22+
run: git checkout -b release/${{ env.RELEASE_VERSION }}
23+
24+
- name: Update changelog
25+
uses: thomaseizinger/keep-a-changelog-new-release@master
26+
with:
27+
version: ${{ env.RELEASE_VERSION }}
28+
29+
- name: Initialize mandatory git config
30+
run: |
31+
git config user.name "GitHub actions"
32+
git config user.email [email protected]
33+
34+
# This step will differ depending on your project setup
35+
- name: Bump version in package.json
36+
run: yarn version --new-version ${{ env.RELEASE_VERSION }}
37+
38+
- name: Commit changelog and manifest files
39+
run: |
40+
git add CHANGELOG.md package.json
41+
git commit --message "Prepare release ${{ env.RELEASE_VERSION }}"
42+
43+
- name: Push new branch
44+
run: git push origin release/${{ env.RELEASE_VERSION }}
45+
46+
- name: Create pull request
47+
uses: thomaseizinger/create-pull-request@v1
48+
with:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
head: release/${{ env.RELEASE_VERSION }}
51+
base: master
52+
title: ${{ github.event.issue.title }}
53+
reviewers: ${{ github.event.issue.user.login }}
54+
body: |
55+
Resolves #${{ github.event.issue.number }}

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Release new version"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
14+
steps:
15+
- name: Extract version from branch name
16+
run: |
17+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
18+
VERSION=${BRANCH_NAME#release/}
19+
20+
echo "::set-env name=RELEASE_VERSION::$VERSION"
21+
- uses: actions/checkout@v2
22+
- name: Create Release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
26+
with:
27+
tag_name: ${{ env.RELEASE_VERSION }}
28+
release_name: ${{ env.RELEASE_VERSION }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.idea

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node
2+
3+
branches:
4+
only:
5+
- release/*

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.0] - 2020-02-15
11+
12+
### Added
13+
14+
- Everything since the beginning!
15+
16+
[Unreleased]: https://github.com/thomaseizinger/github-action-gitflow-release-workflow/compare/1.0.0...HEAD
17+
18+
[1.0.0]: https://github.com/thomaseizinger/github-action-gitflow-release-workflow/compare/794c3ba521cae6b168def8bdbfe1aa6a2c285257...1.0.0

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello world!");

index.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
it('works', function() {
2+
const sum = 2 + 2;
3+
4+
expect(sum).toEqual(4);
5+
});

0 commit comments

Comments
 (0)