Skip to content

Commit

Permalink
Adding GHA for release process
Browse files Browse the repository at this point in the history
* updated docker build to exclude release and tagged branches, and include tags
* Added release action to automate release

closes: #58
  • Loading branch information
Carolyn Russell committed Apr 23, 2021
1 parent 8d89dff commit b1d82fd
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ name: Docker

on:
push:
branches:
- '**'
branches-ignore: # Should publish on main and regular branches, but not release/ or tagged branches
- 'release/**'
- "v[0-9]+.[0-9]+.[0-9]+" # branches matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # branches matching v*, i.e. v1.0-rc1, v20.15.10-rc5
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5

jobs:
docker:
Expand All @@ -14,16 +19,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Prepare
id: prep
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set tag version
id: get_ver
run: |
echo "::set-output name=release_tag::${GITHUB_REF##*/}"
- name: Create release ${{ steps.get_ver.outputs.release_tag }}
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body_path: RELEASE_CHANGELOG.md
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Initial conversions from nhash to hash #44
* Changed ownership on assets #45
* Improved query performance #53
* Added release workflow #58

### Bug Fixes
* Translated the signatures back to usable addresses
Expand Down

0 comments on commit b1d82fd

Please sign in to comment.