Skip to content

Commit

Permalink
EPMDJ-2652 Github Actions - release support. Updated workflows in ord…
Browse files Browse the repository at this point in the history
…er to support release branches, added release skipping. [skip ci]
  • Loading branch information
viktorbll committed May 20, 2020
1 parent 990d5b8 commit 8665140
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 44 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Check common
name: Check
on:
pull_request:
branches:
- develop
paths-ignore:
- '**.md'
- 'LICENSE'
- 'develop'
- 'release/*'
paths:
- '**/src/**'
- '**.gradle.kts'
- 'gradle.properties'

jobs:
check:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish common artifacts
name: Publish
on:
release:
types: [published]
Expand All @@ -15,6 +15,12 @@ jobs:
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v2
- id: to_version
uses: actions/github-script@0.9.0
with:
result-encoding: string
script: |
return '${{ github.event.release.tag_name }}'.replace(/^v/, '');
- uses: actions/setup-java@v1
with:
java-version: 11
Expand All @@ -25,12 +31,6 @@ jobs:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx2g
- id: to_version
uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: return context.payload.release.tag_name.replace(/^v/, '');
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release
on:
push:
branches:
- 'develop'
- 'release/*'
paths:
- '**/src/*[Mm]ain/**'
- '**/src/commonNative/**'
- '**.gradle.kts'
- 'gradle.properties'

jobs:
release:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 20
- run: git fetch
- id: semver_kind
uses: actions/github-script@0.9.0
with:
result-encoding: string
script: |
const branch = '${{ github.ref }}'.substring(11);
return branch.startsWith('release/') ? 'patch' : 'prerelease';
- name: Next SemVer
id: next_semver
uses: Drill4J/semver-tag-action@v0.1.0
with:
type: ${{ steps.semver_kind.outputs.result }}
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ steps.next_semver.outputs.tag }}
release_name: ${{ steps.next_semver.outputs.tag }}
prerelease: ${{ steps.semver_kind.outputs.result == 'prerelease' }}
32 changes: 0 additions & 32 deletions .github/workflows/tag-develop.yml

This file was deleted.

0 comments on commit 8665140

Please sign in to comment.