-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from thomaseizinger/release/1.3.0
Release version 1.3.0
- Loading branch information
Showing
6 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,20 +27,26 @@ jobs: | |
with: | ||
version: ${{ env.RELEASE_VERSION }} | ||
|
||
# In order to make a commit, we need to initialize a user. | ||
# You may choose to write something less generic here if you want, it doesn't matter functionality wise. | ||
- name: Initialize mandatory git config | ||
run: | | ||
git config user.name "GitHub actions" | ||
git config user.email [email protected] | ||
# This step will differ depending on your project setup | ||
# Fortunately, yarn has a built-in command for doing this! | ||
- name: Bump version in package.json | ||
run: yarn version --new-version ${{ env.RELEASE_VERSION }} --no-git-tag-version | ||
|
||
- name: Commit changelog and manifest files | ||
id: make-commit | ||
run: | | ||
git add CHANGELOG.md package.json | ||
git commit --message "Prepare release ${{ env.RELEASE_VERSION }}" | ||
echo "::set-output name=commit::$(git rev-parse HEAD)" | ||
- name: Push new branch | ||
run: git push origin release/${{ env.RELEASE_VERSION }} | ||
|
||
|
@@ -51,6 +57,14 @@ jobs: | |
head: release/${{ env.RELEASE_VERSION }} | ||
base: master | ||
title: ${{ github.event.issue.title }} | ||
reviewers: ${{ github.event.issue.user.login }} | ||
reviewers: ${{ github.event.issue.user.login }} # By default, we request a review from the person who opened the issue. You can replace this with a static list of users. | ||
# Write a nice message to the user. | ||
# We are claiming things here based on the `publish-new-release.yml` workflow. | ||
# You should obviously adopt it to say the truth depending on your release workflow :) | ||
body: | | ||
Resolves #${{ github.event.issue.number }} | ||
Hi ${{ github.event.issue.user.login }}! | ||
This PR was created in response to this release issue: #${{ github.event.issue.number }}. | ||
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}. | ||
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,32 @@ jobs: | |
echo "::set-env name=RELEASE_VERSION::$VERSION" | ||
# Unfortunately, GitHub doesn't trigger events for actions that have been taken by a GitHub action. | ||
# This means we cannot use `Fixes #issue_number.` in the body of the PR to close the release issue after the branch is merged. | ||
# Hence, we close it here "manually" | ||
- name: Close release issue | ||
run: | | ||
RELEASE_ISSUE_URL=$(curl https://api.github.com/repos/${{ github.repository }}/issues?labels=release&state=open | jq -r '.[1].url') | ||
curl \ | ||
-X PATCH \ | ||
-H 'Accept: application/vnd.github.v3+json' \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
$RELEASE_ISSUE_URL \ | ||
-d '{"state":"closed"}' | ||
- name: Create Release | ||
uses: fleskesvor/create-release@feature/support-target-commitish | ||
uses: thomaseizinger/create-release@1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
commitish: ${{ github.event.pull_request.merge_commit_sha }} | ||
target_commitish: ${{ github.event.pull_request.merge_commit_sha }} | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
release_name: ${{ env.RELEASE_VERSION }} | ||
name: ${{ env.RELEASE_VERSION }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Merge release into dev branch | ||
uses: thomaseizinger/[email protected] | ||
|
@@ -45,5 +63,9 @@ jobs: | |
head: release/${{ env.RELEASE_VERSION }} | ||
base: dev | ||
title: Merge release ${{ env.RELEASE_VERSION }} into dev branch | ||
body: | | ||
This PR merges the release branch for ${{ env.RELEASE_VERSION }} back into dev. | ||
This happens to ensure that the updates that happend on the release branch, i.e. CHANGELOG and manifest updates are also present on the dev branch. | ||
# if needed, you can checkout the latest master here, build artifacts and publish / deploy them somewhere | ||
# the create-release action has an output `upload_url` output that you can use to upload assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2020 Thomas Eizinger | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# GitFlow release workflow using GitHub actions | ||
|
||
This repository contains GitHub workflows that allow for fully automated release as per the GitFlow conventions. | ||
You are welcome to use it for inspiration for your own release workflows or maybe even copying them verbatim if the fit your needs. | ||
|
||
## Usage | ||
|
||
If you are using the workflows as they are in this repository, there are only two manual steps for releasing a new version: | ||
|
||
1. Create a ticket that is titled "Release version x.y.z" and label it with "release". | ||
2. Merge the PR that is created for you. | ||
|
||
The automation will do the following things: | ||
|
||
- Update your changelog with the new version | ||
- Change the version in the necessary manifest files | ||
- Tag the final release and create a GitHub release | ||
|
||
## Design | ||
|
||
I've written a blog post that describes the technical design in detail here: https://blog.eizinger.io/12274/using-github-actions-to-automate-gitflow-style-releases | ||
|
||
The idea of these workflows is to automate all the tedious aspects of releases while still allowing manual intervention if necessary and control over crucial aspects. | ||
|
||
I think I've achieved this by doing the following: | ||
|
||
- The individual GitHub actions used are small and focused. | ||
|
||
This allows you to adapt the workflows to your own needs. | ||
Ironically, this is what makes this whole repository not special. | ||
It just takes good ideas that are already out there and creates automation around them. | ||
|
||
- You have full control over what the next version is. | ||
|
||
There is no magic involved, only the tedious things are automated. | ||
You have full control over what is being released and under which version. | ||
|
||
## Hall of fame | ||
|
||
If you are using these workflow or got inspired by them to build something similar, feel free to add yourself to this list: | ||
|
||
- BE THE FIRST ONE! | ||
|
||
## License | ||
|
||
MIT. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "github-action-gitflow-release-workflow", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "index.js", | ||
"author": "Thomas Eizinger <[email protected]>", | ||
"license": "MIT", | ||
|