Skip to content

Commit

Permalink
Release via gh action (#31)
Browse files Browse the repository at this point in the history
Allow automatic release which increases the version number minor (for now)
  • Loading branch information
fwilhe2 authored Dec 27, 2020
1 parent 5dfa9ac commit ce1cb72
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Perform Release
on:
workflow_dispatch:
repository_dispatch:
types: perform_release
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Get Version Number
id: next_version
run: |
echo "::set-output name=version_number::$(npx semver --increment patch $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))"
- run: echo ${{ steps.next_version.outputs.version_number }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.next_version.outputs.version_number }}

- name: Publish to GitHub Packages
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository
env:
USERNAME: fwilhe2
TOKEN: ${{ secrets.GPR_AUTH_TOKEN }}
VERSION: ${{ steps.next_version.outputs.version_number }}

0 comments on commit ce1cb72

Please sign in to comment.