Skip to content

Commit

Permalink
Trigger Release with tag 'releaseTrigger'
Browse files Browse the repository at this point in the history
This changes will trigger a build on master,
when there is a tag 'releaseTrigger' created.

It will notify our normal GitHub Actions, and
retrigger a build. The payload will tell the
our normal build, that this is a release, and
it will trigger the build.

Downside, this will only work in MASTER for now.
If we want to support other branches, we need
to use our combined brain power, how to retrieve
a branch name from a git tag. It is not such
a trivial problem.
  • Loading branch information
Simon Schrottner committed May 2, 2020
1 parent baf46cd commit 171ee03
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 48 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- 'v**'
pull_request:
branches: '*'
repository_dispatch:
types: [releaseTrigger]

jobs:
build:
Expand Down Expand Up @@ -57,7 +59,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
name: Deploy with Shipkit
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' && github.event.client_payload.release
steps:
- name: Sanitize Branch
uses: frabert/replace-string-action@master
Expand All @@ -84,9 +86,10 @@ jobs:
NEXUS_TOKEN_PASSWORD: ${{ secrets.NEXUS_TOKEN_PASSWORD }}
with:
arguments: ciPerformRelease

# - name: Update Page
# uses: eskatos/gradle-command-action@v1
# with:
# arguments: triggerSiteBuild -P travisApiToken=${{ secrets.TRAVIS_API_TOKEN }} --stacktrace

- run: git push --delete origin releaseTrigger
- name: Trigger Website Build
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_WRITE_TOKEN }}
repository: junit-pioneer/junit-pioneer.github.io
event-type: triggerSiteBuild
21 changes: 21 additions & 0 deletions .github/workflows/releaseTrigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Tagged for Releasing

on:
create:
tags:
- 'releaseTrigger'

jobs:
deploy:
runs-on: ubuntu-latest
name: triggering release of master
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_WRITE_TOKEN }}
event-type: triggerRelease
client-payload: '{"release": true}'
41 changes: 0 additions & 41 deletions .github/workflows/tagged.yml

This file was deleted.

0 comments on commit 171ee03

Please sign in to comment.