Skip to content

Merge branch 'main' into release #38

Merge branch 'main' into release

Merge branch 'main' into release #38

Workflow file for this run

# Upon pushing to the release branch a new tag will be created
# in preparation for the release.
#
# Copyright (c) 2022 AlertAvert.com. All rights reserved.
# Author: Marco Massenzio ([email protected])
#
name: Release
on:
push:
branches:
- release
env:
AUTHOR: ${{ github.event.pusher.name }}
EMAIL: ${{ github.event.pusher.email }}
KEYRING_FILE: /tmp/keyring.gpg
jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Create a Release Tag
run: |
git config user.name "$AUTHOR"
git config user.email "<$EMAIL>"
TAG=$(./get-version.sh)
git tag -a $TAG -m "Release $TAG"
git push --tags
echo TAG=${TAG} >> $GITHUB_ENV
- uses: actions/setup-java@v1
with:
java-version: 17
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#storing-base64-binary-blobs-as-secrets
- name: Encode KeyRing file
env:
KEYRING_BASE64: "${{ secrets.SIGNING_KEYRING }}"
run: |
echo "${KEYRING_BASE64}" | base64 -d > ${KEYRING_FILE}
- name: Build gradle.properties with Sonatype Credentials
run: |
cat <<EOF >gradle.properties
ossrhUsername=${{ secrets.SONATYPE_USERNAME }}
ossrhPassword=${{ secrets.SONATYPE_PASSWORD }}
signing.keyId=${{ secrets.SIGNING_KEYID }}
signing.password=${{ secrets.SIGNING_PASSWORD }}
signing.secretKeyRingFile=${KEYRING_FILE}
EOF
# TODO: Automatically push the build artifacts to the nexus repository
- name: Publish to Sonatype
run: |
chmod +x gradlew && ./gradlew publish
# Creates a new release in GitHub, with auto-generated content.
- uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG }}
generateReleaseNotes: true