Skip to content

Add release pipeline #6

Add release pipeline

Add release pipeline #6

Workflow file for this run

name: Release
on:
pull_request:
release:
types: [published]
jobs:
artifact:
name: Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Latest Release
id: previoustag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set Artifact Version
run: |
echo Artifact version: ${{ steps.previoustag.outputs.tag }}
echo "version=${{ steps.previoustag.outputs.tag }}" > gradle.properties
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
#Instead of manually configure caching of gradle, use an action which is provided. Details here: https://github.com/actions/setup-java
cache: gradle
- name: Gradle Build
# if: steps.changes.outputs.source_code == 'true'
id: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build
- name: Publish Artifact
# if: steps.changes.outputs.source_code == 'true'
id: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishMavenPublicationToGitHubPackagesRepository