v 1.3 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org> | |
# | |
# SPDX-License-Identifier: CC0-1.0 | |
name: Publish Release | |
on: | |
push: | |
tags: | |
- '**' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: github.repository == 'alliander-opensource/measure' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: Get release notes | |
run: | | |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | |
echo "$(awk '/^## ${{ github.ref_name }}/{flag=1;next}/^## /{flag=0}flag' CHANGELOG.md)" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Set version for tag | |
run: | | |
echo "ORG_GRADLE_PROJECT_VERSION_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | |
- uses: gradle/actions/setup-gradle@v4 | |
- name: Publish | |
run: ./gradlew :measure:publishToMavenCentral | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | |
# - name: Create Release | |
# uses: softprops/action-gh-release@v2 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# body: ${{ env.RELEASE_NOTES }} | |
# if: ${{ env.RELEASE_NOTES != '' }} |